• Resolved Jan

    (@krugmedien)


    Hi,

    I want to add some job details to the notification email like this:

    function my_sjb_applicant_details_notification( $message, $post_id, $notification_receiver ){
    
        $message .= '<p><b>Category:</b> ';
        $jobpost_categories = get_the_terms( $post_id , 'jobpost_category' );
    
        $i = 1;
        foreach ( $jobpost_categories as $category ) {
            $message .= $category->name;
            $message .= ($i < count($jobpost_categories))? ", " : "";
            $i++;
        }
        $message .= '</p>';
    
        $message .= '<p><b>Type:</b> ';
        $jobpost_job_types = get_the_terms( $post_id , 'jobpost_job_type' );
        $i = 1;
        foreach ( $jobpost_job_types as $job_type ) {
            $message .= $job_type->name;
            $message .= ($i < count($jobpost_job_types))? ", " : "";
            $i++;
        }
        $message .= '</p>';
    
        $message .= '<p><b>Location:</b> ';
        $jobpost_locations = get_the_terms( $post_id , 'jobpost_location' );
        $i = 1;
        foreach ( $jobpost_locations as $location ) {
            $message .= $location->name;
            $message .= ($i < count($jobpost_locations))? ", " : "";
            $i++;
        }
        $message .= '</p>';
    
        return $message;
    
    }
    
    add_filter( 'sjb_applicant_details_notification', 'my_sjb_applicant_details_notification', 10, 3 );

    I already found the filter “sjb_applicant_details_notification”, but the $post_id is the ID of the applicant and NOT the job ID.

    Where is the applicant ID linked with the job ID in the database?
    I couldnt find anything in wp_postmeta.

    Thanks!
    Jan

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Insert Job Details into E-Mail’ is closed to new replies.