Draft Notify – WP Plugin to Send an Email When an Author Saves a Draft

Posted by on February 9, 2013 in Wordpress Plugins | 30 comments

I run multiple blogs and have the ability for people to sign up and write content for me. I was disappointed that WordPress does not have anything built it to alert me with an email notification when a new author writes something. I don’t log into the sites unless I have to, so new content may sit for a while without being noticed. I did find 1 plugin that would accomplish the email, but it was buggy. So I’ve written my own and am willing to share it with you. Specifically this plugin is designed to email you when an author saves a draft. Now there are some additional settings, but check them out below. As always, suggestions are welcome, just leave them in the comments along with any bugs you might encounter.

Draft Notify Current Version

Get the most recent version here, or through the WordPress plugin repository.
Source File and ReadMe Zip
readme

Draft Notify Features

  • Emails when a Draft is saved.
  • Can email a specific email address or all users above a certain access level.
  • Can email out whenever a revision is saved, or it can ignore revisions and only email when the first draft is saved.
  • You can now select a few options on what information you would like emailed to you. Please leave more suggestions for other options you’d like to see in the comments!

Draft Notify Suggestions

  1. Notification options for pages/posts
  2. Multiple email recipients
  3. Select 1 admin instead of emailing all the admins
  4. Ability to customize a From and Reply-To email address

Please leave any suggestions in the comments below.

Donate!




If you love the plugin and would like to support further development, please consider donating a little. Noone funds these WordPress plugins, I do them to better the community and make things a little easier to manage. All Donations are greatly appreciated, Thank you!

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

30 Comments

  1. Working great!

    I’ve added a third line in the email with a link to pending posts (http://…/wp-admin/edit.php?post_status=pending&post_type=post) .

    Not having luck with adding

    $name = “My name”; //senders name$email = “myemail@mail.me”; //senders e-mail addressmail($recipient, $subject, $message, $header);

    to the template though…

    • I can add those things into the options page if you’d like.

      You have a link to the post already, which I can add as well. What other options do you want?

      The author’s name and email address?

    • The Link, Author’s Name, And Author’s email address are all added to the settings page now. You can just click them off if you want to include them in the email.

      Thanks for using the plugin!

  2. Hi,

    With my site I am using smtp to relay mail. What “from” address does the plugin generate email notifications? I think this may be causing me issues relaying via a hotmail account.

    Jason

    • The “from” address should be admin@yourservername.com or something similar. Nothing specific is specified. Are you on shared hosting or your own? I can add a simple field for specifying the from address if that will help you? Let me know!

  3. Thanks for this useful plugin.

    One thing I found irritating though was getting notified of all the posts I was making myself, so I was busy hacking your code to feature a “draftnotifyauthorlevel” – so you can specify that you only want notifications of drafts from authors or editors rather than everyone. Whilst doing so I noticed you’re using wp_user_level, which has been deprecated as of version 3.0.

    You should really be comparing on the content of the contents of the wp_capabilities meta value for users, rather than the integer wp_user_level.

    I’d be happy to send you my version of your code which has the draftnotifyauthorlevel option in it. I think the “proper” way to do it would be to have checkboxes (or a multiple select box) which allows you to choose which user roles you notify of drafts posted by which other user roles. If you see what I mean!

    • Sure you can send it over.

      I don’t actually use the author level, but I could throw an option like that in. I could also just have a checkbox that won’t send it to yourself.

      I’ll actually be releasing an update that works with a spam checker I’m writing as well. I just need to tweak that more before I put it out there.

      • You’ll have to drop me an email so I can send you the code – I can’t find one for you on the site anywhere!

        • Guess I’ll have to change that! I emailed you.

  4. Hi, I would like to use this for a project, but I don’t seem to be receiving emails. I have set up a test Contributor account and made a few test posts. I’ve also configured the plugin to send to my email address and checked my Spam folder but seen nothing. Thank you.

    • First off, does your host allow you to send emails?
      Secondly, try a different email, like a gmail account if you’re using an email address that’s the same as your domain. IE mark@example.com from http://www.example.com Sometimes wordpress does not like this.

  5. Any chance you can make this send notification emails when a post and page (including custom post types) are published? The more options to select specifics, the better. I need a plugin that does all this (and for revisions as your current plugin does) for a company intranet and different admins need to be notified of different post types.

    As far as I can tell, no one has made anything like it so far. And one that could do all these types of notifications would be fantastic. At the very least, email one admin every time a post or page is published and/or revised.

    Thanks.

    • I could throw in an option to select 1 admin instead of emailing all the admins.

      What exactly do you mean by custom post types? Are you talking about categories or something else?

  6. But send email also for add/modify pages! is ti possible only for draft posts? Thank you

    • I’ll see what I can do. There was an option that says first post only. Perhaps something has been changed and that doesn’t work as expected.

  7. The plugin don’t support the ęąśćółżźń when email is sended there is a mess in there

  8. 1. Plugin don’t support ęąśżźćółń. When i get email i get @$$#^&%^*& instead.
    2. There is no po files to tranclate.
    3. Email Address: should be a possibility to add emails like: email@name.com,email2@name2.com,someotheremail@name3.com

    If You fix and add this it will be a great plugin.

    • What is ęąśżźćółń? I have no intention of making it a multilingual plugin.
      I could add multiple emails without issue.

  9. Thank you for the plugin! I was searching such a long time for it!

    • You are very welcome

      • Is it possible, in future versions, that you get only a email for new “pending reviews”?

  10. Thanks for the great plugin!

    Is there an option to only notify for new posts, not pages?

    • Not Right now, but I’ll add it to the list when I upgrade this again.

  11. Howdy,

    I’ve installed the plugin and configured it, but I’m not receiving emails. I’m using WordPress 3.8.1 and version 1.2 of your plugin. Any ideas as to why this might be?

    -Paul

    • Can your server normally send emails?

      • Yep, it’s setup to use SMTP through Google. I’ve just sent myself a test email from the server using Easy SMTP Mail. Looks like when I save a new draft I get the following in my PHP error logs:

        PHP message: PHP Warning: Illegal string offset ‘type’ in /usr/share/nginx/www/wp-content/themes/thesis/lib
        2014/03/26 16:46:38 [error] 734#0: *53163 FastCGI sent in stderr: “in /usr/share/nginx/www/wp-content/themes/thesis/lib/admin/options_post.php on line 150
        PHP message: PHP Warning: Illegal string offset ‘type’ in /usr/share/nginx/www/wp-content/themes/thesis/lib/admin/options_post.php on line 150
        PHP message: PHP Warning: Illegal string offset ‘type’ in /usr/share/nginx/www/wp-content/themes/thesis/lib/admin/options_post.php on line 150
        PHP message: PHP Warning: Illegal string offset ‘type’ in /usr/share/nginx/www/wp-content/themes/thesis/lib/admin/options_post.php on line 150
        PHP message: PHP Warning: Illegal string offset ‘type’ in /usr/share/nginx/www/wp-content/themes/thesis/lib/admin/options_post.php on line 150
        PHP message: PHP Warning: Illegal string offset ‘type’ in /usr/share/nginx/www/wp-content/themes/thesis/lib/admin/options_post.php on line 150
        PHP message: PHP Warning: Illegal string offset ‘type’ in /usr/share/nginx/www/wp-content/themes/thesis/lib/admin/options_post.php on line 150
        PHP message: PHP Warning: Illegal string offset ‘type’ in /usr/share/nginx/www/wp-content/themes/thesis/lib/admin/options_post.php on line 150″ while reading response header from upstream, client: 173.245.52.138, server: website.com, request: “POST /wp-admin/post.php HTTP/1.1″, upstream: “fastcgi://127.0.0.1:9000″, host: “www.website.com”, referrer: “http://www.website.com/wp-admin/post-new.php”

        • A quick Google Search mentioned that it may be because of a WordPress Upgrade. What Version are you running? I’ll see if I have a server with that version to test it with.

  12. Is it possible to get only an email for pending reviews posts?

  13. This is a great plugin and nearly covers exactly what I need.

    I could really do with the ability to change the “from” address of the email, can I hard code this somewhere?

    Also, is it possible to edit the content and subject of the email that is sent. I just need to hard code in a couple of extra bits of information.

    Thanks for a great plugin.
    Matt

    • You can hard code a from address as well as a reply-to address.
      Look for the line that has $headers .= ‘Content-type……’ Should be around line 120 something if I haven’t made too many changes since the release

      add: $headers .= ‘From: webmaster@example.com‘ . “\r\n”
      or: $headers .= ‘Reply-To: webmaster@example.com‘ . “\r\n”

      Thanks for using this!

Leave a Comment

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>