/[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.5, Thu Jul 23 15:00:57 2009 UTC revision 1.3.2.6, Thu Jul 23 16:14:32 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: emaillog.module,v 1.3.2.4 2008/09/30 17:36:21 kbahey Exp $  // $Id: emaillog.module,v 1.3.2.5 2009/07/23 15:00:57 davereid Exp $
3    
4  // Copyright 2007 Khalid Baheyeldin http://2bits.com  // Copyright 2007 Khalid Baheyeldin http://2bits.com
5    
# Line 20  function emaillog_help($path, $arg) { Line 20  function emaillog_help($path, $arg) {
20    }    }
21  }  }
22    
23    /**
24     * Implementation of hook_menu().
25     */
26  function emaillog_menu() {  function emaillog_menu() {
27    $items['admin/settings/logging/emaillog'] = array(    $items['admin/settings/logging/emaillog'] = array(
28      'title' => t('Email logging and alerts'),      'title' => 'Email logging and alerts',
29      'description' => t('Settings for logging and alerts to email addresses.'),      'description' => 'Settings for logging and alerts to email addresses.',
30      'page callback' => 'drupal_get_form',      'page callback' => 'drupal_get_form',
31      'page arguments' => array('emaillog_admin_settings'),      'page arguments' => array('emaillog_admin_settings'),
32      'access arguments' => array('administer site configuration'),      'access arguments' => array('administer site configuration'),
# Line 51  function emaillog_admin_settings() { Line 54  function emaillog_admin_settings() {
54    return system_settings_form($form);    return system_settings_form($form);
55  }  }
56    
57    /**
58     * Implementation of hook_watchdog().
59     */
60  function emaillog_watchdog($log) {  function emaillog_watchdog($log) {
61    global $user;    global $user;
62    
# Line 63  function emaillog_watchdog($log) { Line 69  function emaillog_watchdog($log) {
69    }    }
70  }  }
71    
72    /**
73     * Implementation of hook_mail().
74     */
75  function emaillog_mail($key, &$message, $params) {  function emaillog_mail($key, &$message, $params) {
76    if ($key == 'alert') {    if ($key == 'alert') {
77      $severity_levels = watchdog_severity_levels();      $severity_levels = watchdog_severity_levels();
78      $message['subject']= t('[@site_name] @severity_desc: Alert from your web site',      $message['subject'] = t('[@site_name] @severity_desc: Alert from your web site',
79        array(        array(
80          '@site_name'     => variable_get('site_name', 'Drupal'),          '@site_name'     => variable_get('site_name', 'Drupal'),
81          '@severity_desc' => drupal_ucfirst($severity_levels[$params['severity']]),          '@severity_desc' => drupal_ucfirst($severity_levels[$params['severity']]),
82        ));        ));
83        dpm($message);
84        dpm($params);
85      $message['body'] = theme('emaillog_format', $params);      $message['body'] = theme('emaillog_format', $params);
86    }    }
87  }  }
88    
89    /**
90     * Implementation of hook_theme().
91     */
92  function emaillog_theme() {  function emaillog_theme() {
93    return array(    return array(
94      'emaillog_format' => array(      'emaillog_format' => array(

Legend:
Removed from v.1.3.2.5  
changed lines
  Added in v.1.3.2.6

  ViewVC Help
Powered by ViewVC 1.1.2