I want to disable the emails sent to admins when a new user account is being created, Account details for (user name) at site name. (pending admin approval).
I tried adding the piece of code in the hook_mail_alter function but that does not give me any change. Below is the code change that i made
function hook_mail_alter(&$message) { if ($message['id'] == 'modulename_messagekey') { if ($message['id'] == 'modulename_register_pending_approval_admin') { $message['send'] = FALSE; return; } if (!example_notifications_optin($message['to'], $message['id'])) { // The usual code for sending mails. } } }
Please let me know how can i disable the emails sent to admins. I could not find any place where I can disable the email functionality from the UI end.
Sponsored by SupremePR