Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Looks like it should check for $key == 'account_reminder_email', rather than act on all outgoing mail as I assume it does now. See: http://api.drupal.org/api/function/email_example_mail/6
I'll be happy to patch provide a patch if this is the case...
Comments
Comment #1
jaydub CreditAttribution: jaydub commentedFrom the API page: "Note that hook_mail() is not actually a hook. It is only called for a single module, the module named in the first argument of drupal_mail(). So it's a callback of a type, but not a hook."
So in reality no the key doesn't need to be checked. The key would be used when a module defines and sends multiple emails in which case using the key would allow for logic in hook_mail to be specific to the email being sent.
Comment #2
JimBroad CreditAttribution: JimBroad commentedYes, I see. Just took a closer look at the drupal_mail() code. Thanks for clearing that up.
Comment #3
JimBroad CreditAttribution: JimBroad commentedComment #4
JimBroad CreditAttribution: JimBroad commented