Skip to content

Commit

Permalink
FIX: Job expiry notification template tag not working
Browse files Browse the repository at this point in the history
  • Loading branch information
nithinjohn22 committed Mar 20, 2024
1 parent 327b246 commit 379fa4f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions inc/class-awsm-job-openings-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ public function get_mail_template_tags( $applicant_details, $options = array() )
public static function get_expired_notification_content() {
$options = array(
'enable' => 'enable',
'to' => '{author-email}',
'subject' => 'Job Listing Expired',
'content' => "This email is to notify you that your job listing for [{job-title}] has just expired. As a result, applicants will no longer be able to apply for this position.\n\nIf you would like to extend the expiration date or remove the listing, please log in to the dashboard and take the necessary steps.\n\nPowered by WP Job Openings Plugin",
);
Expand Down
4 changes: 2 additions & 2 deletions wp-job-openings.php
Original file line number Diff line number Diff line change
Expand Up @@ -1872,7 +1872,7 @@ public function expiry_notification_handler( $new_status, $old_status, $post ) {
$from = ( ! empty( $company_name ) ) ? $company_name : get_option( 'blogname' );
$default_from_email = AWSM_Job_Openings_Settings::awsm_from_email();
$from_email = get_option( 'awsm_jobs_author_from_email_notification', $default_from_email );
$to = get_option( 'awsm_jobs_author_to_notification' );
$to = get_option( 'awsm_jobs_author_to_notification', $expiry_default_options['to'] );
$reply_to = get_option( 'awsm_jobs_author_reply_to_notification', get_option( 'awsm_jobs_reply_to_notification' ) );
$cc = get_option( 'awsm_jobs_author_hr_notification' );
$subject = get_option( 'awsm_jobs_author_notification_subject', $expiry_default_options['subject'] );
Expand Down Expand Up @@ -1919,6 +1919,7 @@ public function expiry_notification_handler( $new_status, $old_status, $post ) {
if ( ! empty( $subject ) && ! empty( $content ) ) {
$subject = str_replace( $tag_names, $tag_values, $subject );
$from_email = str_replace( $tag_names, $tag_values, $from_email );
$to = str_replace( $email_tag_names, $email_tag_values, $to );
$reply_to = str_replace( $email_tag_names, $email_tag_values, $reply_to );
$cc = str_replace( $email_tag_names, $email_tag_values, $cc );
$subject = str_replace( $email_tag_names, $email_tag_values, $subject );
Expand Down Expand Up @@ -1996,7 +1997,6 @@ public function expiry_notification_handler( $new_status, $old_status, $post ) {
$tag_values[] = $subject;
$mail_content = str_replace( $tag_names, $tag_values, $mail_content );

$to = str_replace( $email_tag_names, $email_tag_values, $to );
// Now, send the mail.
$is_mail_send = wp_mail( $to, $subject, $mail_content, array_values( $headers ) );

Expand Down

0 comments on commit 379fa4f

Please sign in to comment.