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 -->
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.
PHP (from the English Hypertext Preprocessor - hypertext preprocessor) is a scripting programming language for developing web applications. Supported by most hosting providers, it is one of the most popular tools for creating dynamic websites.
The PHP scripting language has gained wide popularity due to its processing speed, simplicity, cross-platform, functionality and distribution of source codes under its own license.
https://www.php.net/
HTML (English "hyper text markup language" - hypertext markup language) is a special markup language that is used to create sites on the Internet.
Browsers understand html perfectly and can interpret it in an understandable way. In general, any page on the site is html-code, which the browser translates into a user-friendly form. By the way, the code of any page is available to everyone.
https://www.w3.org/html/
Welcome to the Q&A site for web developers. Here you can ask a question about the problem you are facing and get answers from other experts. We have created a user-friendly interface so that you can quickly and free of charge ask a question about a web programming problem. We also invite other experts to join our community and help other members who ask questions. In addition, you can use our search for questions with a solution.
Ask about the real problem you are facing. Describe in detail what you are doing and what you want to achieve.
Our goal is to create a strong community in which everyone will support each other. If you find a question and know the answer to it, help others with your knowledge.