Skip to content

Instantly share code, notes, and snippets.

@bryceadams
Last active June 1, 2016 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bryceadams/ee0a1c65d8ecf6015bb6 to your computer and use it in GitHub Desktop.
Save bryceadams/ee0a1c65d8ecf6015bb6 to your computer and use it in GitHub Desktop.
function listing_published_send_email($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 ).". Well done!
";
wp_mail($author->user_email, "Your job listing is online", $message);
}
add_action('publish_job_listing', 'listing_published_send_email');
@kleampa
Copy link

kleampa commented Mar 3, 2016

You should know this action is triggered anytime when a published job is edited.

@danjjohnson
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment