Here’s a plugin I wrote to take advantage of the pending review feature available in WordPress 2.3 and higher. Note that the latest version of this plugin requires WordPress 3.0 and higher.
With the default pending review feature, you can have “Contributor” users who can write posts. However, these posts are not published until an “Editor” or “Administrator” user comes along and approves the post. What this plugin does is send e-mails at three steps:
- When a Contributor user submits an article for review: The plugin e-mails a list of moderators of your choice, letting them know that there is a post ready for review, and giving them a link to edit the post.
- When a post is approved: The original Contributor user gets an e-mail saying that their post has been approved and who it was approved by. If the post was directly published, the author is given a link to read the post as the whole world sees it. If the post is scheduled to be published, the author is informed of the time that their post will go live. When the post does go live, the author will get another e-mail informing him / her of that.
- When a post’s status is changed back to “draft” from “pending”: The original Contributor user gets an e-mail saying that their post has been reverted back to a draft, along with a link to edit and re-submit the post.
You can assign specific moderators (these must be Administrator or Editor users) to specific Contributor users:
When used with Peter’s Post Notes on WordPress 2.7 and higher, users can leave notes to accompany the e-mails for each step in the workflow.
Get the plugin
Without further ado:
Download Version 2.2.0 of Peter’s Collaboration E-mails for WordPress [July 27, 2016: Replace use of deprecated get_currentuserinfo function. (Thanks Kyle!)]
February 15, 2010: Enhanced version 1.3.3 by François Elie: Adds the ability to define moderators by page; and tree-based page/category moderator fallback logic (by François Elie)
Translations
The following translations are included with the plugin download. Note that version 1.5.0 of the plugin included a lot of new (and untranslated) strings. Please send me any updated or new translation files!
- Castilian Spanish translation by Guillermo and Luis
- Italian translation by Massimo Santi
- French translation by Romain
- Japanese translation by Kazuhiro Terada and Hijili Kosugi
- Brazilian Portuguese translation by Murillo Ferrari
- Romanian translation by Gabriel Berzescu
- Polish translation by Michal Rozmiarek
- German translation by Rian Klijn
- Dutch translation by Rene and Dennis Koot
- Russian translation by Doktor Bro
- Turkish translation by Can Kaya
- Catalan translation by Aleix
- Danish translation by Tom
- Indonesian translation by Syamsul Alam
- Czech translation by Michal Kuk
- Irish translation by Jordan Silaen
Download an old WordPress MU version (not updated since version 1.3.0 of the plugin) here.
Version 2.2.0 [July 27, 2016: Replace use of deprecated get_currentuserinfo function. (Thanks Kyle!)]
Version 2.1.0 [February 12, 2016: Do not e-mail private notes -- new with Peter's Post Notes 1.6.0 and up.]
Version 2.0.0 [Optional message to thank the author for their submission. Also: fixed the scheduled post timestamp. (Thanks Luis González Jaime!)]
Version 1.9.3 [October 7, 2013: Minor button styling improvements. (Thanks daymobrew!) Also: support PHP 5 static function calls, bumping WordPress requirement to 3.2+.]
Version 1.9.2 [March 29, 2013: Bug fix: In some cases, custom taxonomies weren't showing up as an e-mail condition option. (Thanks boxcarpress and jswan2!)]
Version 1.9.1 [January 29, 2013: Fix bug from previous release that broke front-end post submissions.]
Version 1.9.0 [January 23, 2013: Allow editing of plugin settings via the WordPress admin interface so that settings persist after upgrades.]
Version 1.8.2 [January 13, 2013: Fix e-mail text about the author of a post if it has been set by another user. (Thanks Alexander!) Allow editors to manage collaboration e-mail settings in WordPress 3.5+ (required capability is now "manage_categories" instead of "manage_links").]
Version 1.8.1 [October 8, 2012: Rewrite function that gets post type moderators to support collaborators with more restricted permissions. (Thanks Harold!)]
Version 1.8.0 [October 5, 2012: Added approver_user_id custom field upon pending-to-publish and pending-to-future transitions. (Thanks Chris Andrews!)]
Version 1.7.1 [October 3, 2012: Minor fixes for translations. (Thanks Hijili Kosugi!)]
Version 1.7.0 [September 22, 2012: Added e-mails at the "private-to-published" transition (enabled by default), and if a post is edited AND commented using the Peter's Post Notes plugin by another user (thanks Erik!) (disabled by default).]
Version 1.6.2 [September 22, 2011: Minor code edit for WordPress 3.3 compatibility.]
Version 1.6.1 [August 13, 2011: Minor code cleanup to remove unnecessary error notices.]
Version 1.6.0 [June 19, 2011: Added ability to specify contributor and moderator roles for sites with custom roles and capabilities.]
Version 1.5.0 [November 27, 2010: Support for custom post types and taxonomies.]
Version 1.4.0 [September 2, 2010: Added ability to specify contributor and moderator roles for sites with custom roles and capabilities.]
Version 1.3.5 [April 25, 2010: E-mails are now all encoded in UTF-8.]
Version 1.3.4 [January 11, 2010: Plugin now removes its database tables when it is uninstalled, instead of when it is deactivated. This prevents the collaboration rules from being deleted when upgrading WordPress automatically.]
Version 1.3.3 [September 22, 2009: Maintenance release to remove unnecessary code calls and increase security.]
Version 1.3.2 [June 27, 2009: Minor fixes for translations.]
Version 1.3.1 [June 19, 2009: Updated plugin for WordPress 2.8.]
Version 1.3.0 [February 16, 2009: Added e-mails at the "pending-to-future" and "future-to-publish" transitions.]
Version 1.2.2 [February 6, 2009: Added backwards translation support for WordPress 2.5.]
Version 1.2.1 [January 3, 2009: Added .po and .mo files for translators.]
Version 1.2.0 [December 10, 2008: Added another e-mail trigger: when a pending post's status is changed back to a draft. Also added interoperability with Peter's Post Notes (for WordPress 2.7 and up) so that users can leave descriptive notes at each step in the workflow.]
Version 1.1.0 [September 18, 2008: You can specify moderators per post category.]
Version 1.0.1 [August 7, 2008: Database table names no longer use a fixed prefix. They now use whatever your WordPress installation uses ("wp_" by default).]
Version 1.0.0 [July 22, 2008: You can now specify moderators per user.]
Version 0.2.0 [Nov 11, 2007: Two new options: 1) Specify a name and e-mail address to send all e-mails (instead of having the contributor as the sender for pending e-mails and the contributor as the sender for approval e-mails); and 2) Toggle whether to show the contributor, in the approval e-mail, which user approved his / her post.]
Version 0.1.0 [Oct 31, 2007: First version!]
Turkish translation of 0.2.0 by Baris.
Slovakian translation (UTF-8) of 0.1.0 translated by sir.peterson.
Installation
Simply unzip the file peters_collaboration_emails.php to your WordPress plugin directory. Then, activate it in the Plugins menu in the WordPress admin section.
Details about the e-mails sent (who the sender should be; whether the contributor should know who approved his/her post; and so on) are configured by editing the top of the plugin file itself. The default settings should be sufficient for most implementations.
Moderator rules are configured in the Settings > Collaboration e-mails admin menu. Moderators are Administrator or Editor users who should be notified whenever a post is submitted for review. You can create groups of Contributor users and assign different moderators for each group. In other words, different users can be notified based on who wrote a post. You can also assign moderators based on post categories. If a Contributor user belongs to multiple groups and/or a post has multiple categories, all moderators who have been assigned to the relevant groups and categories are e-mailed.
Troubleshooting
Now, whenever you release a plugin the first comments you usually receive are people who have trouble with your plugin. Hopefully I can build a brief troubleshooting section first:
– If you are not receiving any e-mails, make sure that the PHP mail() function is configured properly (ask your web host or if you’re computer-savvy, check it out yourself; or if you have credentials for an SMTP server, install and configure the WP Mail SMTP plugin). If you are trying to send to multiple recipients via SMTP, note that WordPress up to 2.8 has a bug; I described a fix in this post. Also make sure that a Contributor user has actually submitted a post for review.
– If you want to use this plugin with pages, you need to allow the Contributor user to actually create pages (as by default they cannot). Use a plugin such as Capability Manager to add the “edit pages” capability to the Contributor role. With that plugin, you can even create new roles if you’d like.
– If the plugin simply breaks, make sure you are using WordPress 2.5 or higher. Also check the settings near the top of the plugin file (in the WordPress admin section, go to Plugins > Plugin Editor > Peter’s Collaboration E-mails).
– Need help installing the plugin or customizing your installation? Hire my consulting services: petermugo.ca!