Email Log - Version 0.9.2

Version Description

Added filters for more customizing

=

Download this release

Release Info

Developer sudar
Plugin Icon 128x128 Email Log
Version 0.9.2
Comparing to
See all releases

Code changes from version 0.9.1 to 0.9.2

Files changed (2) hide show
  1. email-log.php +16 -17
  2. readme.txt +10 -3
email-log.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
- /*
3
  Plugin Name: Email Log
4
  Plugin URI: http://sudarmuthu.com/wordpress/email-log
5
- Description: Logs every email sent through WordPress. Compatiable with WPMU too.
6
  Donate Link: http://sudarmuthu.com/if-you-wanna-thank-me
7
  Author: Sudar
8
- Version: 0.9.1
9
  Author URI: http://sudarmuthu.com/
10
  Text Domain: email-log
11
 
@@ -33,6 +33,8 @@ Text Domain: email-log
33
  - Handle cases where the headers send is an array
34
  2013-01-08 - v0.9.1 - (Dev time: 0.5 hour)
35
  - Moved the menu under tools (Thanks samuelaguilera)
 
 
36
 
37
  */
38
  /* Copyright 2009 Sudar Muthu (email : sudar@sudarmuthu.com)
@@ -66,6 +68,7 @@ class EmailLog {
66
  private $admin_page;
67
  private $admin_screen;
68
 
 
69
  /**
70
  * Initalize the plugin by registering the hooks
71
  */
@@ -76,7 +79,8 @@ class EmailLog {
76
  global $smel_db_version;
77
 
78
  // Load localization domain
79
- load_plugin_textdomain( 'email-log', false, dirname(plugin_basename(__FILE__)) . '/languages' );
 
80
 
81
  // Register hooks
82
  add_action( 'admin_menu', array(&$this, 'register_settings_page') );
@@ -374,7 +378,7 @@ jQuery('document').ready(function() {
374
  <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
375
  <div class="wrap">
376
  <?php screen_icon(); ?>
377
- <h2><?php _e( 'Email Log Settings', 'email-log' ); ?></h2>
378
 
379
  <p>&nbsp;</p>
380
 
@@ -631,16 +635,16 @@ jQuery('document').ready(function() {
631
 
632
  // Log into the database
633
  $wpdb->insert($this->table_name, array(
634
- 'to_email' => is_array($mail_info['to']) ? $mail_info['to'][0] : $mail_info['to'],
635
- 'subject' => $mail_info['subject'],
636
- 'message' => $mail_info['message'],
637
- 'headers' => is_array($mail_info['headers']) ? implode("\r\n", $mail_info['headers']) : $mail_info['headers'],
638
  'attachments' => $attachment_present,
639
- 'sent_date' => current_time('mysql')
640
  ));
641
 
642
- // return unmodifiyed array
643
- return $mail_info;
644
  }
645
 
646
  /**
@@ -656,11 +660,6 @@ jQuery('document').ready(function() {
656
  private function array_get($array, $key, $default = NULL) {
657
  return isset($array[$key]) ? $array[$key] : $default;
658
  }
659
-
660
- // PHP4 compatibility
661
- function EmailLog() {
662
- $this->__construct();
663
- }
664
  }
665
 
666
  /**
1
  <?php
2
+ /**
3
  Plugin Name: Email Log
4
  Plugin URI: http://sudarmuthu.com/wordpress/email-log
5
+ Description: Logs every email sent through WordPress. Compatible with WPMU too.
6
  Donate Link: http://sudarmuthu.com/if-you-wanna-thank-me
7
  Author: Sudar
8
+ Version: 0.9.2
9
  Author URI: http://sudarmuthu.com/
10
  Text Domain: email-log
11
 
33
  - Handle cases where the headers send is an array
34
  2013-01-08 - v0.9.1 - (Dev time: 0.5 hour)
35
  - Moved the menu under tools (Thanks samuelaguilera)
36
+ 2013-03-14 - v0.9.2 - (Dev time: 0.5 hour)
37
+ - Added support for filters which can be used while logging emails
38
 
39
  */
40
  /* Copyright 2009 Sudar Muthu (email : sudar@sudarmuthu.com)
68
  private $admin_page;
69
  private $admin_screen;
70
 
71
+ const FILTER_NAME = 'wp_mail_log';
72
  /**
73
  * Initalize the plugin by registering the hooks
74
  */
79
  global $smel_db_version;
80
 
81
  // Load localization domain
82
+ $this->translations = dirname(plugin_basename(__FILE__)) . '/languages/' ;
83
+ load_plugin_textdomain( 'email-log', false, $this->translations);
84
 
85
  // Register hooks
86
  add_action( 'admin_menu', array(&$this, 'register_settings_page') );
378
  <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
379
  <div class="wrap">
380
  <?php screen_icon(); ?>
381
+ <h2><?php _e( 'Email Log', 'email-log' ); ?></h2>
382
 
383
  <p>&nbsp;</p>
384
 
635
 
636
  // Log into the database
637
  $wpdb->insert($this->table_name, array(
638
+ 'to_email' => is_array($mail_info['to']) ? $mail_info['to'][0] : $mail_info['to'],
639
+ 'subject' => $mail_info['subject'],
640
+ 'message' => $mail_info['message'],
641
+ 'headers' => is_array($mail_info['headers']) ? implode("\r\n", $mail_info['headers']) : $mail_info['headers'],
642
  'attachments' => $attachment_present,
643
+ 'sent_date' => current_time('mysql')
644
  ));
645
 
646
+ // return filtered array
647
+ return apply_filters(self::FILTER_NAME, $mail_info);
648
  }
649
 
650
  /**
660
  private function array_get($array, $key, $default = NULL) {
661
  return isset($array[$key]) ? $array[$key] : $default;
662
  }
 
 
 
 
 
663
  }
664
 
665
  /**
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: sudar
3
  Tags: email, wpmu, wordpress-mu, log
4
  Requires at least: 2.8
5
- Tested up to: 3.5
6
- Stable tag: 0.9.1
7
 
8
  Logs every email sent through WordPress. Compatible with WPMU too.
9
 
@@ -120,6 +120,13 @@ Extract the zip file and drop the contents in the wp-content/plugins/ directory
120
  ### v0.9.1 (2013-01-08) - (Dev time: 0.5 hour)
121
  * Moved the menu under tools (Thanks samuelaguilera)
122
 
123
- ==Readme Generator==
 
 
 
 
 
 
 
124
 
125
  This Readme file was generated using <a href = 'http://sudarmuthu.com/wordpress/wp-readme'>wp-readme</a>, which generates readme files for WordPress Plugins.
2
  Contributors: sudar
3
  Tags: email, wpmu, wordpress-mu, log
4
  Requires at least: 2.8
5
+ Tested up to: 3.5.1
6
+ Stable tag: 0.9.2
7
 
8
  Logs every email sent through WordPress. Compatible with WPMU too.
9
 
120
  ### v0.9.1 (2013-01-08) - (Dev time: 0.5 hour)
121
  * Moved the menu under tools (Thanks samuelaguilera)
122
 
123
+ ### v0.9.2 (2013-03-14) - (Dev time: 0.5 hour)
124
+ * Added support for filters which can be used while logging emails
125
+
126
+ == Upgrade Notice ==
127
+
128
+ = 0.9.2 = Added filters for more customizing
129
+
130
+ == Readme Generator ==
131
 
132
  This Readme file was generated using <a href = 'http://sudarmuthu.com/wordpress/wp-readme'>wp-readme</a>, which generates readme files for WordPress Plugins.