Skip to content

Instantly share code, notes, and snippets.

@danjjohnson
Last active June 1, 2016 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danjjohnson/d5250224d85ed952819637f1cec95589 to your computer and use it in GitHub Desktop.
Save danjjohnson/d5250224d85ed952819637f1cec95589 to your computer and use it in GitHub Desktop.
Send email to candidate when resume is approved
function resume_published_send_email($post_id) {
if( 'resume' != get_post_type( $post_id ) ) {
return;
}
$post = get_post($post_id);
$author = get_userdata($post->post_author);
$message = "
Hi ".$author->display_name.",
Your resume, ".$post->post_title." has just been approved at ".get_permalink( $post_id ).". Well done!
";
wp_mail($author->user_email, "Your resume is online", $message);
}
add_action('pending_to_publish', 'resume_published_send_email');
add_action('pending_payment_to_publish', 'resume_published_send_email');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment