e476e64c4810f57e2b469d450464ab7d61e03993
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / mail_alter.twig
1 /**
2  * Implements hook_mail_alter().
3  */
4 function {{ machine_name }}_mail_alter(&$message) {
5   if ($message['id'] == 'modulename_messagekey') {
6     if (!example_notifications_optin($message['to'], $message['id'])) {
7       // If the recipient has opted to not receive such messages, cancel
8       // sending.
9       $message['send'] = FALSE;
10       return;
11     }
12     $message['body'][] = "--\nMail sent out from " . variable_get('site_name', t('Drupal'));
13   }
14 }