Detailed Customization of PublishPress Revisions Emails

One of our major goals for PublishPress Revisions is a more customizable system of notifications.

Before that larger project is complete, it is possible to customize your notifications by adding code to your site's functions.php file. This code below will allow you to change the following:

  • Recipient email addresses
  • Email subject
  • Email content

You can also narrow down when the notifications send based on these criteria:

  • Post ID of revision
  • Post ID of published post
  • Notification type
add_filter(
 'revisionary_mail', 
 function($mail, $args) {
    // $mail['address'] = array of recipient email addresses
    // $mail['title'] = email subject
    // $mail['message'] = email content

    // $args['revision_id'] = Post ID of revision
    // $args['post_id'] = Post ID of main / published post
    // $args['notification_type'] ='pending-revision' | 'revision-approval' | 'publish-scheduled'

    // $args['notification_class'] =  'rev_submission_notify_author' | 'rev_submission_notify_monitor' | 'rev_submission_notify_admin' | 'rev_approval_notify_author' | 'rev_approval_notify_admin' | 'rev_approval_notify_super_admin' | 'rev_approval_notify_revisor' | 'publish_scheduled_notify_revisor' | 'publish_scheduled_notify_author' | 'publish_scheduled_notify_admin'

     // modify the $mail array as desired before returning.
     return $mail;
 },
10, 2
);

Professional publishing plugins for WordPress! Get PublishPress