Send an email notification to the organizer when a event listing is approved

Send email notification to organizer once the event listing is approved

It will be very helpful in communication strategies if you will send the email notification to organizers once their event listing is approved.

For that, Add the below code to functions.php file:


function send_email_notification_to_organizer($post_id) {
   $post = get_post($post_id);
   $author = get_userdata($post->post_author);

   $message = "
      Hi ".$author->display_name.",
      Your listing, ".$post->post_title." has just been approved at ".get_permalink( $post_id ).". 
   wp_mail($author->user_email, "Your event listing got published!", $message);
add_action('publish_event_listing', 'send_email_notification_to_organizer');

You can customize the message easily.

Use a plugin such as Post Status Notifier Lite.