Email Log WordPress Plugin

download
53,875 downloads

Logs every email sent through WordPress and provides a UI where you can view them.

Viewing logged emails

The logged emails will be stored in a separate table and can be viewed from the admin interface. While viewing the logs, the emails can be filtered or sorted based on the date, email, subject etc.

Deleting logged emails

In the admin interface, all the logged emails can be delete in bulk or can also be selectively deleted based on date, email and subject.

Resend email (Pro addon)

You can buy the Resend email pro addon, which allows you to resend the email directly from the email log. The addon allows you to modify the different fields before resending the email. The cost of the addon is $15 and you can buy it through paypal.

More Fields (Pro addon)

You can buy the More Fields pro addon, which shows additional fields in the email log page. The following are the additional fields that are added by this addon.

  • From
  • CC
  • BCC
  • Reply To
  • Attachment

The cost of the addon is $15 and you can buy it through paypal.

Forward email (Pro addon)

You can buy the Forward email pro addon, which allows you to send a copy of all the emails send from WordPress, to another email address. The addon allows you to choose whether you want to forward through to, cc or bcc fields. This can be extremely useful when you want to debug by analyzing the emails that are sent from WordPress. The cost of the addon is $15 and you can buy it through paypal.

Cleaning up db on uninstall

As recommended by Ozh, the Plugin has an uninstall hook which will clean up the database when the Plugin is uninstalled.

Development

The development of the Plugin happens over at github. If you want to contribute to the Plugin, fork the project at github and send me a pull request.

If you are not familiar with either git or Github then refer to this guide to see how fork and send pull request.

If you are looking for ideas, then you can start with one of the following TODO items 🙂

TODO for Future releases

The following are the features that I am thinking of adding to the Plugin, when I get some free time. If you have any feature request or want to increase the priority of a particular feature, then let me know.

  • Add option to automatically delete the logs periodically
  • Add an option to export logs as csv file
  • Add the ability to resend the emails. Done in Resend Email Add-on
  • Make it MU compatible. Done in v1.7

Support

  • If you have found a bug/issue or have a feature request, then post them in github issues
  • If you have a question about usage or need help to troubleshoot, then post in WordPress forums or leave a comment in Plugins’s home page
  • If you like the Plugin, then kindly leave a review/feedback at WordPress repo page.
  • If you find this Plugin useful or and wanted to say thank you, then there are ways to make me happy 🙂 and I would really appreciate if you can do one of those.
  • If anything else, then contact me in twitter.

Stay updated

I would be posting updates about this Plugin in my blog and in Twitter. If you want to be informed when new version of this Plugin is released, then you can either subscribe to this blog’s RSS feed or follow me in Twitter.

You can also checkout some of the other Plugins that I have released.

Download

You can download the Plugin as a zip file from the WordPress official Plugin directory.

Screenshots

  1. email-log screenshot 1

    The above screenshot shows how the logged emails will be displayed by the Plugin

  2. email-log screenshot 2

    This screenshot shows how you can configure the email display screen. You can choose the fields and the number of emails per page

  3. email-log screenshot 3

    This screenshot shows the additional fields that will be added by the more fields addon

  4. email-log screenshot 4

    The above screenshot shows how the logged emails will be displayed by the Plugin after you install the more fields addon

  5. email-log screenshot 5

    This screenshot shows the settings page of forward email addon

Installation

Normal WordPress installations

Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation and then activate the Plugin from Plugins page.

FAQ

Q. The content of the email is not getting logged when I am using wpmandrill plugin
A. wpmandrill plugin has a bug that prevents this plugin from logging the content of the email. More details about the bug is available at http://wordpress.org/support/topic/mandrill-is-changing-the-names-of-args-in-the-filter?replies=1. I have asked the author of the plugin to fix it and it might get fixed it the next release. Meanwhile, I have added a hack to handle this condition in v1.7.3 of my plugin. So if the content is not getting logged, then upgrade to v1.7.3.

Changelog

v1.9.1 – (2016-07-02) – (Dev time: 0.5 hour)

  • Fix: Only allow users with manage_option capability to view email content.

v1.9 – (2016-06-19) – (Dev time: 6 hours)

  • Fix: Improve the performance of count query (issue #33)
  • Docs: Added access modifiers to class methods
  • Docs: Removed unused array_get() method
  • Docs: Inline documentation added
  • Tests: Added Unit tests

v1.8.2 (2016-04-20) – (Dev time: 1 hour)

  • Tweak: Log all emails from the TO field. Earlier the plugin was logging only the first email
  • Fix: Fixed issues in parsing reply-to and content-type headers

v1.8.1 (2015-12-27) – (Dev time: 0.5 hour)

  • Fix: Fixed the “Delete All Logs” issue that was introduced in v1.8

v1.8 (2015-12-26) – (Dev time: 5 hours)

  • New: Added filters and actions for addons
  • New: Added Resend Email Addon
  • Tweak: Optimize for large number of logs
  • Tweak: Use charset and collate that is defined in wp-config.php file
  • Tweak: Format email content
  • Tweak: Remove PHP4 compatible code
  • Fix: Sanitize the delete email log url

v1.7.5 (2014-09-23) – (Dev time: 1 hour)

  • Tweak: Remove PHP 4.0 compatibility code
  • Tweak: Tweak the install code (issue #26)
  • Fix: Include JavaScript only when needed
  • Fix: Fix a bug in the save user options function (issue #27)

v1.7.4 (2014-07-24) – (Dev time: 0.5 hours)

  • Fix: Handle cases where date_format or time_format are empty (issue #23)
  • Tweak: Remove excessive comments from include/class-email-log-list-table.php (issue #10)

v1.7.3 (2014-05-14) – (Dev time: 0.5 hours)

  • Fix: Fixed a compatibility issue with wpmandrill plugin (issue #20)

v1.7.2 (2014-04-16) – (Dev time: 0.5 hours)

  • Fix: Fix issue in register_activation_hook

v1.7.1 (2014-04-02) – (Dev time: 0.5 hours)

  • Fix: Fix the issue that was preventing the tables to be created

v1.7 (2014-03-29) – (Dev time: 2.5 hours)

  • Fix: Fix whitespace
  • New: Add support for WordPress Multisite (issue #18)
  • New: Add ability to delete all logs at once (issue #19)

v1.6.2 (2014-01-27) – (Dev time: 0.5 hours)

  • Fix: Fix unexpected output while activating the plugin

v1.6.1 (2013-12-17) – (Dev time: 0.5 hours)

  • Fix: Change prepare_items function so that it adheres to strict mode
  • Fix: Remove screen_icon function call which is not used in WordPress 3.8
  • New: Compatible with WordPress 3.8

v1.6 (2013-12-08) – (Dev time: 0.5 hours)

  • New: Add a link to view the content of the email in the log screen

v1.5.4 (2013-09-21) – (Dev time: 0.5 hours)

  • Fix issue in searching non-english characters
  • Add addon screenshots

v1.5.3 (2013-09-14) – (Dev time: 0.5 hours)

  • Fix issue in bulk deleting logs

v1.5.2 (2013-09-13) – (Dev time: 0.5 hours)

  • Add the ability to override the fields displayed in the log page
  • Add support for “More Fields” addon

v1.5.1 (2013-09-09) – (Dev time: 0.5 hours)

  • Correct the upgrade file include path. Issue #7
  • Fix undfined notice error. Issue #8
  • Update screenshots. Issue #6

v1.5 (2013-09-09) – (Dev time: 10 hours)

  • Rewrote Admin interface using native tables

v1.1 (2013-04-27) – (Dev time: 0.5 hour)

  • Added more documentation

v1.0 (2013-04-17) – (Dev time: 0.5 hour)

  • Added support for buying pro addons

v0.9.3 (2013-04-01) – (Dev time: 0.5 hour)

  • Moved table name into a separate constants file

v0.9.2 (2013-03-14) – (Dev time: 0.5 hour)

  • Added support for filters which can be used while logging emails

v0.9.1 (2013-01-08) – (Dev time: 0.5 hour)

  • Moved the menu under tools (Thanks samuelaguilera)

v0.9(2013-01-08) – (Dev time: 1 hour)

  • Use blog date/time for send date instead of server time
  • Handle cases where the headers send is an array

v0.8.1 (2012-07-23) (Dev time: 0.5 hour)

  • Reworded most error messages and fixed lot of typos

v0.8 (2012-07-12) (Dev time: 1 hour)

v0.7 (2012-06-23) (Dev time: 1 hour)

  • Changed Timestamp(n) MySQL datatype to Timestamp (now compatible with MySQL 5.5+)
  • Added the ability to bulk delete checkboxes

v0.6 (2012-04-29) (Dev time: 2 hours)

  • Added option to delete individual email logs
  • Moved pages per screen option to Screen options panel
  • Added information to the screen help tab
  • Added Lithuanian translations

v0.5 (2012-01-01)

  • Fixed a deprecation notice

v0.4 (2010-01-02)

  • Added German translation (Thanks Frank)

v0.3 (2009-10-19)

  • Added compatibility for MySQL 4 (Thanks Frank)

v0.2 (2009-10-15)

  • Added compatibility for MySQL 4

v0.1 (2009-10-08)

  • Initial Release

69 Comments so far

Follow up comments through RSS Feed | Post a comment

  • After installation the table doesn’t exist. When I try to create it with phpMyAdmin I get this error message: Too big column length for column ‘subject’ (max = 255). Use BLOB instead.
    Frank

    • Sudar says:

      @Frank,

      Thanks for reporting the issue. I guess it is related to the version of MySQL. I had access to only MySQL 5, so tested it only in that. Would be really helpful for me to fix it, if you could let me know the version of MySQL. You can find it in phpMyAdmin itself.

      • You are right: the version is 4.0.27.

        • Sudar says:

          @Frank,

          Thanks for confirming the MySQL version number. I will modify the table creation script to make it work in MySQL 4 also.

        • Sudar says:

          @Frank,

          I have released an updated version (v0.2) of the Plugin which fixes the issue with MySQL 4. Try it out and let me know if it works for you.

          Thanks for reporting the issue.

          • Frank Weichbrodt says:

            Thank You for working on this problem.
            But the is a new error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘CURRENT_TIMESTAMP, UNIQUE KEY id (id)’

            Frank

            • Sudar says:

              @Frank,

              Thanks for helping me to fix the compatibility issue with MySQL 4. I have released a new version of the Plugin with the fixes.

  • ovidiu says:

    the instructions seem wrong to me. dropping a folder into mu-plugins usually does nothing…

    if I only activate it for the main blog, will I see all emails that have been sent on the whole wpmu installation?

    • Sudar says:

      @Ovidiu,

      Thanks for pointing it out. I am not very much familiar with WordPress MU, so it may be wrong. I will test it again and will change the instructions.

  • Russell Hunt says:

    Hi,

    Just wondering if in future developments we can look at the body of what was in the email, inside the wordpress admin panel, as opposed to having to look it up in the MySQL database?

    Using Firefox so don’t know if something is missing or if I am missing something? LOL

    Good app though, love it 😀

    • Sudar says:

      Yeah, it there in my todo list, will work on it when I get some free time.

      • Magnus says:

        Love your plugin! Just checking to see if you’ve managed to work anything on this? Would be a great addition, especially for community sites that require moderation like sites running BuddyPress which is increasing rapidly in popularity.

  • Ovidiu says:

    another weird story is that I just sent out an email to all registered users of my formerly wpmu based, now wp 3.0.1 multi-site enabled blogging platform and your email says I sent a whole bunch of emails to no recipient? See screen shot please: http://screencast.com/t/MDQwYzBlMTgt

  • Steve says:

    Great plugin! The only issue I have with it, is that it shows me the server time (CST) and not the time I have set up in WordPress.
    Unfortunately, I can’t change the server time, as I am on a shared server.
    Is there any workaround to this?

  • Gytis says:

    I use it log user contacts (wp_mail is used to send mails to admin)
    Question is this logging SQL injection protected?

  • Israel says:

    I updated to the latest version and now it seems like the plugin is not registering new emails in the log and also if I try to delete the logs it will fail. Looking at the PHP errors, I see this: WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘)’ at line 1 for query DELETE FROM wp_email_log where id IN () made by require_once(‘wp-admin/admin.php’), do_action(‘tools_page_email-log’), call_user_func_array, EmailLog->settings_page

    • Sudar says:

      I just tried using the latest version of the Plugin and I am not getting any issues.

      Can you give me these additional information so that I can debug it?

      – MySQL version
      – PHP Version
      – WordPress Version
      – Plugin Version

  • Israel says:

    The issue happened after doing the update from the previous version to the current one. I removed the plugin and reinstalled it and it seems to be doing okay now. Anyways, the PHP is 5.3, WP is 3.4.2, MySQL 5.0, plugin 0.9.1. Thanks.

    • Sudar says:

      It is still strange, because I did a update myself and was not facing this issue. Anyways will keep this in mind and see if I can replicate it.

  • Israel says:

    Hello Sudar,
    I would like to give a suggestion for your plugin (or maybe another plugin). It would be really nice if we had the option to resend an email that was previously sent.
    I have noticed that sometimes WordPress fails to send some emails… a lot of people who use GoDaddy have issues with emails not being delivered. I just recently changed my SMTP to another service other than GoDaddy and so far my WordPress installation failed to send only one email. Your plugin logged the email as sent, but the server failed to actually send the email out.
    This would be a really good add-on to your plugin!
    Hope you can take this into consideration.
    Thanks!

    • Sudar says:

      That’s actually a very nice feature to have. The only problem is that my Plugin (or WordPress for that matter) has no way to know whether the email failed or not.

      Anyway added it to the TODO list. Will implement it when I get some free time of if someone is ready to sponsor the feature 😉

      • Israel says:

        That would be fantastic, Sudar!
        I agree with you, WordPress has no way of knowing if the email was sent or not. In my case, I compare the logs from your plugin with the logs of the SMTP service I use and then I am able to determine if WordPress failed to send any of the emails. If everything is going fine, the number of emails sent that is shown in your plugin matches the number of emails sent showing on my SMTP service. If the numbers are different, I can compare the logs. If your plugin has the feature to resend the email, then I can ask your plugin to attempt to send the email again.
        I really appreciate your consideration implementing this feature. I have not seen any other plugin out there that can do this so far.
        Thanks!

  • Anonymous says:

    I want to update the email confirmation of registration, where should I change?

  • giselevreis says:

    I want to update the email confirmation of registration, where should I change?

  • John says:

    Just used WordPress Plugin for the first time. My Email list is about fifty, plugin showed only two sent. I have confirmed that at least three where sent.
    Using Bluehost as provider and Subscribe 2 as Email send program.

    Will take a few days to confirm any others sent. However something is wrong. Any help is appreciated. Tell me where to start looking for problem.

    Thanks,
    John

    • Sudar says:

      Hello John,

      How did you confirm that the email was sent?

      Also note that, one limitation of the Plugin is that the emails that were sent through wp_mail function in WordPress only will be logged.

      • HI Sudar: Seems to be logging only Emails sent to jw@jwlwgardens.com which is the blogs Email program. My list of others would all have individual Emails. Comment Emails are also being logged. Will the Pro add on allow me to correct this?

        Thanks for the help,
        John

        • Sudar says:

          John,

          My Plugin will log emails that are sent through wp_mail function in WordPress. If any plugin sends email using other functions will not be logged.

          No the pro addon will not change this. The Pro addon will only allow you to forward all emails that are sent to another email address.

  • Hi Sudar: There was a problem at my provider (Blue Host) at the time of my last post. Not sure the emails were allowed to go. Will be posting again soon, will see what happens then.

    Thanks for the help,
    John

  • Ryan Carter says:

    Hi Sudar, I’m looking for a little information on the ‘Forward email pro’ addon for your wordpress email plugin ‘Email Users’ Could you possibly email me so I can get the question answered before I purchase?

  • Fran says:

    I paid for the pro addon how do i get it?

  • marikamitsos says:

    Hello Sudar,
    We are testing (on wordpress 3.6) the new v.1.5.1 -which looks and feels great !!!!! (Thank you)

    We are facing a problem though with the Search Logs.
    It ONLY returns (on subject) results that start with english characters. To understand better, here are three (3) different scenarios, with various search terms when the subject is:

    “The man Άντονυ Κουΐν, who is “:
    1. the man –> 1 results
    2. Άντονυ –> 0 results
    3. who is –> 0 results

    Also:
    “Άντονυ Κουΐν, who is the man “:
    1. the man –> 0 results
    2. Άντονυ Κουΐν –> 0 results

    As you see there seems to be an issue/bug with NON-english characters.

    Could you please have a look at it?

    thank you

  • Howard says:

    Following an upgrade I get this error – Fatal error: Class name must be a valid object or a string in /var/sites/m/moatplayers.co.uk/public_html/wp-content/plugins/email-log-forward-email/email-log-forward-email.php on line 62

    How do I fix this?

    • Sudar says:

      I just checked and the latest version of email-log and the addon plugin version and everything seems to be working.

      Can you tell me what are your

      1. WordPress version
      2. PHP version
      3. Email Log plugin version
  • Howard says:

    Hi, its odd, it just seems to be the upgrade process. After it stalls, i rename the plugin folder, reinstall the plugin and all is ok again.

    WP 3.5.2
    PHP 5.3.10
    Email Log 1.5.4 & Forwarder 0.1

    • Sudar says:

      That for the details. I think I have figured out the reason why you are getting this error. The addon depends on email log pluign and during update, WordPress disables the email log plugin and that is the reason for the error.

      I have added some conditions to prevent this error in v0.2 of the addon and have emailed them to you.

  • angelpayy says:

    How do I change the time on my email log? The time it is showing is incorrect.

  • Ben says:

    Hi I have the latest version of your plugin, wp and MySQL.

    However no logs are being kept. They used to be kept but not anymore.

    I have it network activated on my MU.

    some sites keep logs but others do not.

    Please advise on how to fix this.

    Ben

    • Sudar says:

      My plugin is not fully compatible with multisite, when it is network activated and I am currently working on fixing it.

      Meanwhile can you try to individually activate the plugin on your different blogs?

    • Sudar says:

      Hello Ben,

      I just released v1.7 of the plugin which has full compatibility with WordPress multisite.

      Kindly update to the latest version and let me know if you still face any issues.

  • jpw94 says:

    Is there a way to delete all log entries in a single command?

  • jpw94 says:

    Delete all logs feature = Awesome! Thank you!

  • Stefan says:

    Hi!
    Unfortunately i deleted one e-mail from log. Can i retrace this e-mail?
    Thanks,
    Stefan

    • Sudar says:

      Unfortunately there is no way to retrieve the email log from the plugin.

      But if you have a backup of the WordPress db, then you can find the log inside the wp-email-log table.

      • Stefan says:

        Thanks for your instantly hint! Unfortunately my last backup was yesterday and i received the deleted e-mail today – before the next backup. It can´t be helped – that´s life.
        In the backup of the WordPress db from yesterday i can see all older e-mails. Good to know.
        Thank you!

  • Joe Capone says:

    Any idea when you plan to add the feature for resending emails?

    • Sudar says:

      Hello Joe,

      It is in my todo list, but unfortunately I don’t have a timeline on it yet.

      Would you be interested in sponsoring that feature?

  • jared says:

    Hi-
    Can you set the date range for the email log? For instance is there a date range like 15 days or something that the log keeps in the table.

    For some reason only have about 12 days of logs in my table? I want set this to keep all emails in the log forever if possible.

    I can’t find any settings for this plugin.

    Please advise.

    Thanks so much.

    JHared

  • John Choe says:

    I found something that you would be interested in email log wp plug in.

    I ran into where email log admin shows blank and tracked it down to

    $total_items = $wpdb->query( $query );

    from the plug-in’s class-email-log-list-table.php’s prepareItems function.

    This line fails and quits php process altogether.

    This issue happens when the number of rows is large. In my case, we have over 19,000 rows that the query returns.

    I found a simple fix by replacing the query on the long query with a query of just count and getting a value.

    $countQuery = str_replace(“SELECT ​* FROM “,”SELECT COUNT(*​) FROM “, $query);

    $total_items = $wpdb->get_var($countQuery);
    // Pagination parameters
    //$total_items = $wpdb->query( $query ); //return the total number of affected rows

  • Mordechai Buxner says:

    This plugin used to be invaluable for our WooCommerce store, but at a certain point it just stopped working. This may be tied to the fact that we have sent hundreds of thousands of e-mails by this point. Regardless, it worked again when I changed line 286 of include/class-email-log-list-table.php from:

    $count_query = ‘SELECT * FROM ‘ . $table_name;

    To:

    $count_query = ‘SELECT COUNT(*) FROM ‘ . $table_name;

  • Sumit P says:

    Hi Sudar,

    I am not able to purchase on PayPal. It is asking me to use different card. Do you have any other payment method? Also, I believe PayPal does not allow india-india transactions.

    • Sudar says:

      Hello Sumit,

      Yeah paypal doesn’t allow India-India transactions. If you are from India then we can do direct bank transfer.

      Let me know if that is fine with you. I can send you my bank details through email.

19 Trackbacks/Pingbacks so far

Leave a Reply

Your email address will not be published. Required fields are marked *