0

Is there a possibility to notify a list of users when a post changes its contents? I am using MailPoet at the moment but tips for any plugin would be helpful.

The newsletter plugins I have found so far only notify when new posts are created. Not when they change.

EDIT: I have tried as well the "Email Post Changes" plugin but it doesn't support a mailing-list and it shows the post changes as colored diff. I would like a newsletter to notify subscribers.

0

You can use a hook developed for such kind of purposes: post_updated

Use this hook whenever you need to compare values before and after the post update.

Lets get some codding:

function mail_on_update($post_ID, $post_after, $post_before){
    if($post_after->post_content !=  $post_before->post_content){
        // wp_mail() , mail() here
    }
}

add_action( 'post_updated', 'mail_on_update', 10, 3 ); // 10 - priority, 3 - qty of parameters passed to action callback.

Put this code in your theme functions.php and modify with conditional logic for mailing.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.