Automatically send a post to an admin email
-
I’ve searched quite a bit and haven’t found a plugin that will send a post to a specific email every time something is published. So, I’ve decided to create my own plugin, but an running into a problem with the variable populating. The email is sent, but the subject and content are empty. I know this has to be a simple problem, but I can’t figure it out.
function clbg_send_post($post_ID) {
$email= '[email protected]';
$post_title = the_title();
$post_content = the_content();
mail($email, $post_title, $post_content);
return $post_ID;
}add_action('publish_post', 'clbg_send_post');
Viewing 12 replies - 1 through 12 (of 12 total)
Viewing 12 replies - 1 through 12 (of 12 total)
- The topic ‘Automatically send a post to an admin email’ is closed to new replies.