hhetpanchal
Forum Replies Created
-
Forum: Plugins
In reply to: [Simple Job Board] Send the uploaded CV to HRI tried below code but it was not working at all.
// Filter to Attach HR Resume
add_filter(‘sjb_hr_notification_attachment’, ‘custom_code_for_hr_resume_attachment’, 20, 2);function custom_code_for_hr_resume_attachment( $resume_path, $post_id ){
// Write custom code here.
return get_post_meta($post_id, ‘resume’, TRUE);}
So Now I manage to upload file using below code and it is working absolutely perfect.
if you want to send email to HR email address please open class-simple-job-board-notification.php. This file you will find under simple-job-board/includes/class-simple-job-board-notification.php.
public static function hr_notification($post_id) {
// Applied job title
$job_title = get_the_title($post_id);
$to = apply_filters( ‘sjb_hr_notification_to’, get_option(‘settings_hr_email’) );
$subject = apply_filters( ‘sjb_hr_notification_sbj’ , ‘Applicant Resume Received[‘ . $job_title . ‘]’, $job_title );
$message = self::job_notification_templates($post_id, ‘HR’);
$headers = array(‘Content-Type: text/html; charset=UTF-8’);
$attachments_url = get_post_meta($post_id, ‘resume’, TRUE);
$attachment_explode = explode(“wp-content”, $attachments_url);
$attachments = array( WP_CONTENT_DIR .$attachment_explode[1]);
//$attachment = apply_filters( ‘sjb_hr_notification_attachment’, ”, $post_id );
if (” != $to)
wp_mail( $to, $subject, $message, $headers, $attachments );
}Modify hr_notification function and following code:
$attachments_url = get_post_meta($post_id, ‘resume’, TRUE);
$attachment_explode = explode(“wp-content”, $attachments_url);
$attachments = array( WP_CONTENT_DIR .$attachment_explode[1]);Thank you. Happy coding.