Created
April 29, 2016 07:37
-
-
Save danjjohnson/a24edacf7943e70d3a163bf329534edc to your computer and use it in GitHub Desktop.
WP Job Manager: Send an email to employer when their job listing expires
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function listing_expired_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 now expired: ".get_permalink( $post_id ); | |
wp_mail($author->user_email, "Your job listing has expired", $message); | |
} | |
add_action('expired_job_listing', 'listing_expired_send_email'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment