/[drupal]/contributions/modules/logging_alerts/emaillog/emaillog.module
ViewVC logotype

Diff of /contributions/modules/logging_alerts/emaillog/emaillog.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.3.2.7, Thu Jul 23 16:15:52 2009 UTC revision 1.3.2.8, Thu Jul 23 16:28:59 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: emaillog.module,v 1.3.2.6 2009/07/23 16:14:32 davereid Exp $  // $Id: emaillog.module,v 1.3.2.7 2009/07/23 16:15:52 davereid Exp $
3    
4  // Copyright 2007 Khalid Baheyeldin http://2bits.com  // Copyright 2007 Khalid Baheyeldin http://2bits.com
5    
# Line 29  function emaillog_menu() { Line 29  function emaillog_menu() {
29      'page callback' => 'drupal_get_form',      'page callback' => 'drupal_get_form',
30      'page arguments' => array('emaillog_admin_settings'),      'page arguments' => array('emaillog_admin_settings'),
31      'access arguments' => array('administer site configuration'),      'access arguments' => array('administer site configuration'),
32        'file' => 'emaillog.admin.inc',
33    );    );
34    return $items;    return $items;
35  }  }
36    
 function emaillog_admin_settings() {  
   $form['emaillog'] = array(  
     '#type' => 'fieldset',  
     '#title' => t('Email addresses for each severity level.'),  
     '#description' => t('Enter an email address for each severity level. For example, you may want to get emergency and critical levels to your pager or mobile phone, while notice level messages can go to a regular email. If you leave the email address blank for a severity level, no email messages will be sent for that severity level.'),  
   );  
   foreach (watchdog_severity_levels() as $severity => $description) {  
     $description = drupal_ucfirst($description);  
     $key = 'emaillog_' . $severity;  
     $form['emaillog'][$key] = array(  
       '#type' => 'textfield',  
       '#title' => t('Email address for severity @description', array('@description' => $description)),  
       '#default_value' => variable_get($key, ''),  
       '#description' => t('The email address to send log entries of severity @description to.', array('@description' => $description)),  
     );  
   }  
   
   return system_settings_form($form);  
 }  
   
37  /**  /**
38   * Implementation of hook_watchdog().   * Implementation of hook_watchdog().
39   */   */
# Line 79  function emaillog_mail($key, &$message, Line 60  function emaillog_mail($key, &$message,
60          '@site_name'     => variable_get('site_name', 'Drupal'),          '@site_name'     => variable_get('site_name', 'Drupal'),
61          '@severity_desc' => drupal_ucfirst($severity_levels[$params['severity']]),          '@severity_desc' => drupal_ucfirst($severity_levels[$params['severity']]),
62        ));        ));
63      dpm($message);      $message['body'] = theme('emaillog_format', $params, $message);
     dpm($params);  
     $message['body'] = theme('emaillog_format', $params);  
64    }    }
65  }  }
66    

Legend:
Removed from v.1.3.2.7  
changed lines
  Added in v.1.3.2.8

  ViewVC Help
Powered by ViewVC 1.1.2