Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WPJM Send Resume Expired Email
function resume_expired_send_email( $new_status, $old_status, $post ) {
if ( 'resume' !== $post->post_type || 'expired' !== $new_status || $old_status === $new_status ) {
return;
}
$author = get_userdata( $post->post_author );
$message = "
Hi " . $author->display_name . ",
Your resume, " . $post->post_title . " has now expired: " . get_permalink( $post_id );
wp_mail( $author->user_email, "Your job resume has expired", $message );
}
add_action( 'transition_post_status', 'resume_expired_send_email', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.