Sends out email to admin

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

Related posts

Leave a Reply

3 comments

  1. 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 );
    }