Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('draft_to_publish' ,'send_emails_on_new_event');
- function send_emails_on_new_event($post)
- {
- if(get_post_type($post->ID) === 'ttshowcase')
- {
- $emails = get_option('admin_email');
- $title = wp_strip_all_tags(get_the_title($post->ID));
- $url = get_permalink($post->ID);
- $message = "Link to testimonial single page: \n{$url}";
- wp_mail($emails, "New testimonial published: {$title}", $message);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement