Although the module shows as available for D6, it doesn't ever send any e-mail since the drupal_mail parameters changed between D5 -> D6, viz:

D5: drupal_mail($mailkey, $to, $subject, $body, $from = NULL, $headers = array())

D6: drupal_mail($module, $key, $to, $language, $params = array(), $from = NULL, $send = TRUE)

Patch requires correction of params and use of hook_mail to form up the e-mail for dispatch:

function emaillog_watchdog($log) {
  $to = variable_get('emaillog_' . $log['severity'], '');
  if ($to) {
    // Send email only if there is an email address. Otherwise the message is ignored
    // by this module.
    $language = user_preferred_language($account);
    drupal_mail('emaillog', 'alert', $to, $language, $log);
  }
}

function emaillog_mail($key, &$message, $params) {
  switch($key) {
  case 'alert':
    $severity_list = emaillog_severity_list();
    $message['subject']= t('[@site_name] @severity_desc: Alert from your web site', array(
      '@site_name' => variable_get('site_name', 'Drupal'),
      '@severity_desc' => $severity_list[$params['body']['severity']]));
    $message['body'] = theme('emaillog_format', $params);
    break;
  }
}

hook_help and hook_menu also need tweaks. See attached.

rgds
nigel bruin.

CommentFileSizeAuthor
emaillog.module.zip2.02 KBnigel.bruin

Comments

dawehner’s picture

Status: Active » Closed (fixed)

this seemed to be fixed in dev version so closed