function simple_mail_mail_alter in Simple Mail 8
Same name and namespace in other branches
- 7 simple_mail.module \simple_mail_mail_alter()
- 2.0.x simple_mail.module \simple_mail_mail_alter()
Implements hook_mail_alter().
Override email 'to' address, if configured.
File
- ./
simple_mail.module, line 35 - Simple Mail module.
Code
function simple_mail_mail_alter(&$message) {
// Re-route emails when override email variable is set.
$override_email = \Drupal::config('simple_mail.settings')
->get('override');
if (!empty($override_email)) {
$message['to'] = $override_email;
}
}