Last active
July 13, 2018 21:46
-
-
Save init90/9169230dd165e6de4bfbd9a8d77662e5 to your computer and use it in GitHub Desktop.
Drupal 7, Disable mail sending if condition is right.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_mail_alter(). | |
*/ | |
function MYMODULE_mail_alter(&$message) { | |
if ($message['key'] == 'register_confirmation_with_pass') { | |
$user = $message['params']['account']; | |
// If user account need to approve we ignore standard mail after registration | |
// because we have custom mails for this case. | |
if (lb_registration_account_need_to_approve($user)) { | |
$message['send'] = FALSE; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment