Sends out email to admin

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 = '[email protected]';
    $subject="mail subject here";
    $message = "your message here ex: new post published at: ".get_permalink($post_id);
    wp_mail($to, $subject, $message );
}

Leave a Comment