[SD-974] Refactored the code for checking email notification are allowed or not.