Skip to content

Commit bc824dc

Browse files
committed
FIX: Showing undifined function in expiry notifi
1 parent 892166f commit bc824dc

File tree

2 files changed

+25
-16
lines changed

2 files changed

+25
-16
lines changed

inc/class-awsm-job-openings-form.php

+17-11
Original file line numberDiff line numberDiff line change
@@ -708,10 +708,13 @@ public static function get_expired_notification_content() {
708708
* @return array
709709
*/
710710
public static function get_notification_options( $type ) {
711-
$options = array();
712-
$admin_email = get_option( 'admin_email' );
713-
$hr_email = get_option( 'awsm_hr_email_address' );
714-
$expired_options = self::get_expired_notification_content();
711+
$options = array();
712+
$admin_email = get_option( 'admin_email' );
713+
$hr_email = get_option( 'awsm_hr_email_address' );
714+
$expired_options = self::get_expired_notification_content();
715+
if ( ! class_exists( 'AWSM_Job_Openings_Settings' ) ) {
716+
require_once AWSM_JOBS_PLUGIN_DIR . '/admin/class-awsm-job-openings-settings.php';
717+
}
715718
$default_from_email = AWSM_Job_Openings_Settings::awsm_from_email();
716719

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

791794
if ( $enable ) {
792-
$admin_email = get_option( 'admin_email' );
793-
$hr_mail = get_option( 'awsm_hr_email_address' );
794-
$applicant_email = $applicant_details['awsm_applicant_email'];
795-
$company_name = get_option( 'awsm_job_company_name' );
796-
$from = ( ! empty( $company_name ) ) ? $company_name : get_option( 'blogname' );
797-
$author_id = get_post_field( 'post_author', $applicant_details['awsm_job_id'] );
798-
$author_email = get_the_author_meta( 'user_email', intval( $author_id ) );
795+
$admin_email = get_option( 'admin_email' );
796+
$hr_mail = get_option( 'awsm_hr_email_address' );
797+
$applicant_email = $applicant_details['awsm_applicant_email'];
798+
$company_name = get_option( 'awsm_job_company_name' );
799+
$from = ( ! empty( $company_name ) ) ? $company_name : get_option( 'blogname' );
800+
$author_id = get_post_field( 'post_author', $applicant_details['awsm_job_id'] );
801+
$author_email = get_the_author_meta( 'user_email', intval( $author_id ) );
802+
if ( ! class_exists( 'AWSM_Job_Openings_Settings' ) ) {
803+
require_once AWSM_JOBS_PLUGIN_DIR . '/admin/class-awsm-job-openings-settings.php';
804+
}
799805
$default_from_email = AWSM_Job_Openings_Settings::awsm_from_email();
800806

801807
$tags = $this->get_mail_template_tags(

wp-job-openings.php

+8-5
Original file line numberDiff line numberDiff line change
@@ -1865,11 +1865,14 @@ public function expiry_notification_handler( $new_status, $old_status, $post ) {
18651865
if ( $new_status !== 'publish' && $new_status !== $old_status && $post->post_type === 'awsm_job_openings' ) {
18661866
if ( $new_status === 'expired' ) {
18671867
if ( $enable_expiry === 'enable' ) {
1868-
$job_id = $post->ID;
1869-
$admin_email = get_option( 'admin_email' );
1870-
$hr_mail = get_option( 'awsm_hr_email_address' );
1871-
$company_name = get_option( 'awsm_job_company_name' );
1872-
$from = ( ! empty( $company_name ) ) ? $company_name : get_option( 'blogname' );
1868+
$job_id = $post->ID;
1869+
$admin_email = get_option( 'admin_email' );
1870+
$hr_mail = get_option( 'awsm_hr_email_address' );
1871+
$company_name = get_option( 'awsm_job_company_name' );
1872+
$from = ( ! empty( $company_name ) ) ? $company_name : get_option( 'blogname' );
1873+
if ( ! class_exists( 'AWSM_Job_Openings_Settings' ) ) {
1874+
require_once AWSM_JOBS_PLUGIN_DIR . '/admin/class-awsm-job-openings-settings.php';
1875+
}
18731876
$default_from_email = AWSM_Job_Openings_Settings::awsm_from_email();
18741877
$from_email = get_option( 'awsm_jobs_author_from_email_notification', $default_from_email );
18751878
$to = get_option( 'awsm_jobs_author_to_notification', $expiry_default_options['to'] );

0 commit comments

Comments
 (0)