Skip to content

Commit

Permalink
FIX: Showing undifined function in expiry notifi
Browse files Browse the repository at this point in the history
  • Loading branch information
nithinjohn22 committed Jul 16, 2024
1 parent 892166f commit bc824dc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
28 changes: 17 additions & 11 deletions inc/class-awsm-job-openings-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -708,10 +708,13 @@ public static function get_expired_notification_content() {
* @return array
*/
public static function get_notification_options( $type ) {
$options = array();
$admin_email = get_option( 'admin_email' );
$hr_email = get_option( 'awsm_hr_email_address' );
$expired_options = self::get_expired_notification_content();
$options = array();
$admin_email = get_option( 'admin_email' );
$hr_email = get_option( 'awsm_hr_email_address' );
$expired_options = self::get_expired_notification_content();
if ( ! class_exists( 'AWSM_Job_Openings_Settings' ) ) {
require_once AWSM_JOBS_PLUGIN_DIR . '/admin/class-awsm-job-openings-settings.php';
}
$default_from_email = AWSM_Job_Openings_Settings::awsm_from_email();

if ( $type === 'applicant' ) {
Expand Down Expand Up @@ -789,13 +792,16 @@ protected function notification_email( $applicant_details, $data = array() ) {
}

if ( $enable ) {
$admin_email = get_option( 'admin_email' );
$hr_mail = get_option( 'awsm_hr_email_address' );
$applicant_email = $applicant_details['awsm_applicant_email'];
$company_name = get_option( 'awsm_job_company_name' );
$from = ( ! empty( $company_name ) ) ? $company_name : get_option( 'blogname' );
$author_id = get_post_field( 'post_author', $applicant_details['awsm_job_id'] );
$author_email = get_the_author_meta( 'user_email', intval( $author_id ) );
$admin_email = get_option( 'admin_email' );
$hr_mail = get_option( 'awsm_hr_email_address' );
$applicant_email = $applicant_details['awsm_applicant_email'];
$company_name = get_option( 'awsm_job_company_name' );
$from = ( ! empty( $company_name ) ) ? $company_name : get_option( 'blogname' );
$author_id = get_post_field( 'post_author', $applicant_details['awsm_job_id'] );
$author_email = get_the_author_meta( 'user_email', intval( $author_id ) );
if ( ! class_exists( 'AWSM_Job_Openings_Settings' ) ) {
require_once AWSM_JOBS_PLUGIN_DIR . '/admin/class-awsm-job-openings-settings.php';
}
$default_from_email = AWSM_Job_Openings_Settings::awsm_from_email();

$tags = $this->get_mail_template_tags(
Expand Down
13 changes: 8 additions & 5 deletions wp-job-openings.php
Original file line number Diff line number Diff line change
Expand Up @@ -1865,11 +1865,14 @@ public function expiry_notification_handler( $new_status, $old_status, $post ) {
if ( $new_status !== 'publish' && $new_status !== $old_status && $post->post_type === 'awsm_job_openings' ) {
if ( $new_status === 'expired' ) {
if ( $enable_expiry === 'enable' ) {
$job_id = $post->ID;
$admin_email = get_option( 'admin_email' );
$hr_mail = get_option( 'awsm_hr_email_address' );
$company_name = get_option( 'awsm_job_company_name' );
$from = ( ! empty( $company_name ) ) ? $company_name : get_option( 'blogname' );
$job_id = $post->ID;
$admin_email = get_option( 'admin_email' );
$hr_mail = get_option( 'awsm_hr_email_address' );
$company_name = get_option( 'awsm_job_company_name' );
$from = ( ! empty( $company_name ) ) ? $company_name : get_option( 'blogname' );
if ( ! class_exists( 'AWSM_Job_Openings_Settings' ) ) {
require_once AWSM_JOBS_PLUGIN_DIR . '/admin/class-awsm-job-openings-settings.php';
}
$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', $expiry_default_options['to'] );
Expand Down

0 comments on commit bc824dc

Please sign in to comment.