php - Job location is not showing up in the auto-generated email on Simple Job Plugin of Wordpress
one text
I am trying to get the Job location into this auto-generated PHP email that gets sent out to the HR department. This is a Wordpress plugin called "Simple Job Board", and a lot of things do reference to custom variables so the variables were created by them. We have three locations, and what I am trying to do is put the job location inside of the email so I can set up rules on the email side so when "XX" location is detected, it will auto-forward it to the correct location. I am not receiving any syntax errors, but the location is not displaying in the email. Here is what this entire section looks like:
/**
* Admin Email Template
*
* @since 2.4.5
*
* @param int $post_id Post ID
* @param string $notification_receiver Notification Receiver (Admin or HR or || Applicant)
* @return string $message Admin Email Template
*/
public static function admin_email_template( $post_id, $notification_receiver ) {
// Applied Job Title
$job_title = get_the_title($post_id);
// Applicant Name
$applicant_name = self::applicant_details('name', $post_id);
$admin = esc_html__('Admin', 'simple-job-board');
$message = sprintf( esc_html__('Hi %s', 'simple-job-board'), $admin ) . ',</p>';
$message .= '<p>' . esc_html__('We just wanted to let you know that someone applied for the', 'simple-job-board') . ' <b>' . esc_attr($job_title) . '</b> ' . esc_html__('position at the', 'simple-job-board') . ' <b>' . esc_attr($job_location) . ' </b> ' . esc_html__('facility. Please head over to wordpress and see your new applicant!', 'simple-job-board') . '</p>';
/**
* Hook -> Applicant details.
*
* Add applicant's details in notification template.
*
* @since 2.2.3
*
* @param int $post_id Post Id
* @param string $notification_receiver Notification Receiver
* @return string $message Message Template
*/
$message = apply_filters('sjb_applicant_details_notification', $message, $post_id, $notification_receiver);
$message .= '<p>' . esc_html__('We will notify you if another applicant applies!', 'simple-job-board') . '</p>'
. esc_html__('Warm Regards,', 'simple-job-board') . '<br>';
/**
* Modify Admin Email Template
*
* @since 2.4.5
*
* @param string $message Admin Email Template
* @param int $post_id Post Id
* @param string $notification_receiver Notification Receiver
*/
return apply_filters( 'sjb_admin_email_template', $message, $post_id, $notification_receiver );
}
Now the area I am focusing on with this issue is the message itself and the esc_attr($job_location):
$message .= '<p>' . esc_html__('We just wanted to let you know that someone applied for the', 'simple-job-board') . ' <b>' . esc_attr($job_title) . '</b> ' . esc_html__('position at the', 'simple-job-board') . ' <b>' . esc_attr($job_location) . ' </b> ' . esc_html__('facility. Please head over to wordpress and see your new applicant!', 'simple-job-board') . '</p>';
Any help is appreciated. I already got in contact with the developers of the plugin. However, they didn't provide too much support. Thanks!
EDIT: This is what the main section of the "locations.php" looks like:
<!-- Start Job's Location
================================================== -->
<?php if ($job_location = sjb_get_the_job_location()) {
?>
<div class="col-md-3 col-sm-4 col-xs-12">
<div class="job-location"><i class="fa fa-map-marker"></i><?php sjb_the_job_location(); ?></div>
</div>
<?php } ?>
<!-- ==================================================
End Job's Location -->
Source