You are here

function emaillog_mail in Logging and alerts 7

Same name and namespace in other branches
  1. 8 emaillog/emaillog.module \emaillog_mail()
  2. 6.2 emaillog/emaillog.module \emaillog_mail()
  3. 6 emaillog/emaillog.module \emaillog_mail()
  4. 7.2 emaillog/emaillog.module \emaillog_mail()
  5. 2.0.x emaillog/emaillog.module \emaillog_mail()

Implements hook_mail().

File

emaillog/emaillog.module, line 54
Drupal Module: Email Logging and Alerts

Code

function emaillog_mail($key, &$message, $params) {
  switch ($key) {
    case 'alert':
      $severity_list = watchdog_severity_levels();
      $message['subject'] = t('[@site_name] @severity_desc: @dblog_message', array(
        '@site_name' => variable_get('site_name', 'Drupal'),
        '@severity_desc' => drupal_strtoupper($severity_list[$params['severity']]),
        '@dblog_message' => _emaillog_format_dblog_message($params),
      ));
      $message['body'][] = theme('emaillog_format', $params);
      break;
  }
}