• Resolved rstoeckel1

    (@rstoeckel1)


    I am trying to change the template that gets sent out to admin & HR and wanted to add the Job Location into the message, along with the Job Title. When adding the esc_attr($job_location) into the message I am getting hit with the following error:

    Your PHP code changes were rolled back due to an error on line 254 of file /srv/htdocs/wp-content/plugins/simple-job-board/includes/class-simple-job-board-notifications.php. Please fix and try saving again.

    syntax error, unexpected ‘esc_attr’ (T_STRING)

    Here is what my code looks like inside of the email area:

     $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>';
    

    Not sure what is throwing wordpress off, unless it is just an ending tag somewhere. Any suggestions? Thanks!

    • This topic was modified 4 years, 10 months ago by rstoeckel1.
    • This topic was modified 4 years, 10 months ago by rstoeckel1.
    • This topic was modified 4 years, 10 months ago by rstoeckel1.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @rstoeckel1,

    Thanks for writing to us.

    You are facing the issue because you are not properly concatenating ‘<b>’ and esc_attr($job_location). Please consider the code below and check if it works.

     $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>';
    Thread Starter rstoeckel1

    (@rstoeckel1)

    Hey there Arsalan,

    I just tried the code that you had sent me and I am no longer getting the syntax error! The only issue now is the email that gets sent out does not contain the location in it. Here is a sample email that gets sent out.

    Hi Admin,
    We just wanted to let you know that someone applied for the Test Job position at the facility. Please head over to WordPress and see your new applicant!
    We will notify you if another applicant applies!
    Warm Regards,

    The location should be in this line:

    We just wanted to let you know that someone applied for the Test Job position at the_______facility

    I am going to keep playing around with this and see if I can find something. Thank you so much for the help so far!!

    • This reply was modified 4 years, 10 months ago by rstoeckel1.
    • This reply was modified 4 years, 10 months ago by rstoeckel1.
    • This reply was modified 4 years, 10 months ago by rstoeckel1.

    Hi @rstoeckel1,

    We are glad to hear the error has been resolved.

    We would suggest you take help from WP Developer to fix this issue for you.

    Feel free to reach out for further assistance.

    Regards,

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Syntax error when editing HR email’ is closed to new replies.