Function added to hook “new_to_publish” not executing – custom plugin
Question
I was creating a custom plugin which was to send certain emails based on the content/category of a post, but whilst trying to do that, I ran into some problems just getting a basic email sent out. Am I hooking on to the wrong function here? When I publish a post, nothing happens.
<?php
/**
* Plugin Name: Conditional Emailing
* Description: Sends emails based on categories.
* Version: 1.0
* Author: Ceds
*/
add_action( 'new_to_publish', 'conditional_email', 10, 0);
function conditional_email() {
wp_mail('my@email.com','test','test');
}
?>
What am I doing wrong here?
0
email, hooks, plugins, posts, publish
7 years
2016-12-14T06:59:44-05:00
2016-12-14T06:59:44-05:00 0 Answers
85 views
0
Leave an answer