diff --git a/includes/class-notifications.php b/includes/class-notifications.php index fd93c32..c235d55 100644 --- a/includes/class-notifications.php +++ b/includes/class-notifications.php @@ -62,8 +62,16 @@ class DDHH_JM_Notifications { } // Get post meta fields - $job_location = get_post_meta( $post->ID, 'job_location', true ); - $job_type = get_post_meta( $post->ID, 'job_type', true ); + $job_location = get_post_meta( $post->ID, 'job_location', true ); + $job_type = get_post_meta( $post->ID, 'job_type', true ); + $job_deadline = get_post_meta( $post->ID, 'job_deadline', true ); + $job_contact_email = get_post_meta( $post->ID, 'job_contact_email', true ); + + // Format deadline if present + $deadline_formatted = 'Nicht angegeben'; + if ( ! empty( $job_deadline ) ) { + $deadline_formatted = date( 'd.m.Y', strtotime( $job_deadline ) ); + } // Get submission date $submission_date = get_the_date( 'd.m.Y H:i', $post->ID ); @@ -81,6 +89,8 @@ class DDHH_JM_Notifications { "Anbieter: %s (%s)\n" . "Standort: %s\n" . "Art: %s\n" . + "Bewerbungsfrist: %s\n" . + "Kontakt-E-Mail: %s\n" . "Eingereicht am: %s\n\n" . "Prüfen Sie das Stellenangebot hier:\n%s\n\n" . "---\n" . @@ -90,6 +100,8 @@ class DDHH_JM_Notifications { $author_org, $job_location ? $job_location : 'Nicht angegeben', $job_type ? $job_type : 'Nicht angegeben', + $deadline_formatted, + $job_contact_email ? $job_contact_email : 'Nicht angegeben', $submission_date, $edit_link ); @@ -144,8 +156,16 @@ class DDHH_JM_Notifications { } // Get post meta fields - $job_location = get_post_meta( $post->ID, 'job_location', true ); - $job_type = get_post_meta( $post->ID, 'job_type', true ); + $job_location = get_post_meta( $post->ID, 'job_location', true ); + $job_type = get_post_meta( $post->ID, 'job_type', true ); + $job_deadline = get_post_meta( $post->ID, 'job_deadline', true ); + $job_contact_email = get_post_meta( $post->ID, 'job_contact_email', true ); + + // Format deadline if present + $deadline_formatted = 'Nicht angegeben'; + if ( ! empty( $job_deadline ) ) { + $deadline_formatted = date( 'd.m.Y', strtotime( $job_deadline ) ); + } // Get submission date $submission_date = current_time( 'd.m.Y H:i' ); @@ -163,6 +183,8 @@ class DDHH_JM_Notifications { "Anbieter: %s (%s)\n" . "Standort: %s\n" . "Art: %s\n" . + "Bewerbungsfrist: %s\n" . + "Kontakt-E-Mail: %s\n" . "Bearbeitet am: %s\n\n" . "Prüfen Sie das Stellenangebot hier:\n%s\n\n" . "---\n" . @@ -172,6 +194,8 @@ class DDHH_JM_Notifications { $author_org, $job_location ? $job_location : 'Nicht angegeben', $job_type ? $job_type : 'Nicht angegeben', + $deadline_formatted, + $job_contact_email ? $job_contact_email : 'Nicht angegeben', $submission_date, $edit_link ); @@ -233,8 +257,16 @@ class DDHH_JM_Notifications { } // Get post meta fields - $job_location = get_post_meta( $post->ID, 'job_location', true ); - $job_type = get_post_meta( $post->ID, 'job_type', true ); + $job_location = get_post_meta( $post->ID, 'job_location', true ); + $job_type = get_post_meta( $post->ID, 'job_type', true ); + $job_deadline = get_post_meta( $post->ID, 'job_deadline', true ); + $job_contact_email = get_post_meta( $post->ID, 'job_contact_email', true ); + + // Format deadline if present + $deadline_formatted = 'Nicht angegeben'; + if ( ! empty( $job_deadline ) ) { + $deadline_formatted = date( 'd.m.Y', strtotime( $job_deadline ) ); + } // Get deactivation reason from post meta $deactivation_reason = get_post_meta( $post->ID, 'job_deactivation_reason', true ); @@ -258,6 +290,8 @@ class DDHH_JM_Notifications { "Anbieter: %s (%s)\n" . "Standort: %s\n" . "Art: %s\n" . + "Bewerbungsfrist: %s\n" . + "Kontakt-E-Mail: %s\n" . "Deaktiviert am: %s\n\n" . "Grund für Deaktivierung:\n%s\n\n" . "Stelle ansehen:\n%s\n\n" . @@ -268,6 +302,8 @@ class DDHH_JM_Notifications { $author_org, $job_location ? $job_location : 'Nicht angegeben', $job_type ? $job_type : 'Nicht angegeben', + $deadline_formatted, + $job_contact_email ? $job_contact_email : 'Nicht angegeben', $deactivation_date, $deactivation_reason ? $deactivation_reason : 'Nicht angegeben', $edit_link