Email notification via WP_Mail on published custom post type

I’ve been trying to get an email notification to fire when a new custom post type (in this case, “event”), is published. I’ve tried a few things and settled down to this simple example that, I imagine, should work just fine.

function admin_event_notification()
{

   $message = "Test";
   wp_mail( 'jonathan@sabramedia.com', 'New Event', $message );


}
add_action( 'new_event', 'admin_event_notification', 10, 3 );

Any ideas what I’m missing?

Read More

Once that works, the next step is accessing $post to get the title and permalinks, etc. I think I’ve got that covered, but any ideas are welcomed.

Related posts

Leave a Reply

1 comment