Last active
August 29, 2015 14:15
-
-
Save bryceadams/4cd7940fc51e39d9a7ce to your computer and use it in GitHub Desktop.
WP Job Manager (Applications) - New Application email to candidate with attachment
This file contains hidden or 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
<?php | |
add_action( 'new_job_application', 'send_new_job_application_confirmation', 10, 2 ); | |
function send_new_job_application_confirmation( $application_id, $job_id ) { | |
$candidate_email = get_post_meta( $application_id, '_candidate_email', true ); | |
$message = sprintf( "Thanks for your application for '%s'. We'll get back to you as soon as possible.", get_the_title( $job_id ) ); | |
$headers = array( 'From: Your Name <[email protected]>' ); | |
$attachments = array( WP_CONTENT_DIR . '/uploads/file_to_attach.zip' ); // Direct link to a file you want to attach | |
wp_mail( $candidate_email, 'Your Application on ' . get_bloginfo( 'name' ), $message, $headers, $attachments ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment