Tags/topics: 
2
Answers
Vote up!
1
Vote down!

Turn off all emails

I want to disable all of the emails that Commerce sends, and then use hooks to send them selectively. The second bit, I can manage. Question: how do I turn off ALL the emails that Commerce sends, especially those tied to customer profiles.

THANKS!

Asked by: jherr
on July 3, 2012

2 Answers

Vote up!
2
Vote down!

// commerce sends WAY too many emails. let's manage them
function MODULENAME_mail_alter( &$message ) {
// block all of the commerce auto-emails
// dsm( $message['key'] ); // find the key to block
if( $message['key'] == 'rules_action_mail_rules_send_an_order_notification_e_mail_3' ) {
$message['send'] = FALSE;
}
}

Answer by: jherr
Posted: Jul 3, 2012
Vote up!
0
Vote down!

It doesn't appear that commerce is using drupal_mail() to send mail, which is too bad because it prevents me from using hook_mail_alter.

Answer by: jherr
Posted: Jul 3, 2012

Comments

I'm a dope. I had my hook_ identifier messed up.

- jherr on July 3, 2012