Are there any plugin or code that sends out a email to me (admin) when a author or writer publish a post?

3 s
3

No need for plugin here are a few lines of code you can modify and paste in your themes functions.php file and you will get a new email whenever a post is published:

add_action('publish_post', 'send_admin_email');
function send_admin_email($post_id){
    $to = 'admin@email.here';
    $subject="mail subject here";
    $message = "your message here ex: new post published at: ".get_permalink($post_id);
    wp_mail($to, $subject, $message );
}

Leave a Reply

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