jeudi 3 décembre 2015

Wordpress email notification when published post is edited by user other than admin

I am having many user logins and they all can edit their own published post. I want a email notification when they edit their published post. I have tried following code

    add_action('update_post', 'send_my_mail_on_update_post' );

    function send_my_mail_on_update_employees( $post_id){
    $post_title = get_the_title( $post_id );
    $subject = '[Post]-' .$post_title;
    $admin_email = get_option( 'admin_email' );
    $message = "A post has been updated on your website:\n\n";
    $message .= "" .$post_title. "\n\n";
   //send email to admin
   wp_mail( $admin_email, $subject, $message );
  }

when ever user creates a new post and submits for review i am getting email notification with the following action

 add_action('pending_post', 'send_my_mail_on_draft_notification' );

I am looking for a action hook like 'pending_post' which can be used when a published post is edited/updated by other user.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire