Closed (fixed)
Project:
Logging and alerts
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Apr 2008 at 07:49 UTC
Updated:
28 Mar 2009 at 09:38 UTC
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.
| Comment | File | Size | Author |
|---|---|---|---|
| emaillog.module.zip | 2.02 KB | nigel.bruin |
Comments
Comment #1
dawehnerthis seemed to be fixed in dev version so closed