You are here

function update_detailed_email_mail_alter in Update Status Detailed Email 6

Same name and namespace in other branches
  1. 7 update_detailed_email.module \update_detailed_email_mail_alter()

Implementation of hook_mail_alter().

The update status email needs to be intercepted so it can be changed to HTML.

File

./update_detailed_email.module, line 64
Adds detail to the email message Drupal core's Update Status sends.

Code

function update_detailed_email_mail_alter(&$message) {
  if ($message['id'] == 'update_status_notify') {
    if (module_exists('update')) {
      module_load_include('inc', 'update', 'update.report');
      if (function_exists('update_status')) {
        $message['headers']['Content-Type'] = 'text/html';
        if (module_exists('token')) {
          $message['subject'] = token_replace(variable_get('update_detailed_email_subject', t('Updates Available')));
        }
        else {
          $message['subject'] = variable_get('update_detailed_email_subject', t('Updates Available'));
        }
        $message['body'] = array();
        $message['body'][] = update_status();
      }
    }
  }
}