• 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)
  • kashifrai

    (@kashifrai)

    Hi @krugmedien

    Thanks for being in touch with us.

    Unfortunately, the applicant posts are not being saved in wp_postmeta, this table only contains information of meta boxes against posts. However, you can get the relevant data of the applicant’s posts against applicant_id through the table of wp_posts.

    Feel free to reach out for further assistance.

    Regards,

    Plugin Author PressTigers

    (@presstigers)

    Hello @krugmedien,

    Please use this WP function to get the parent ID (Job ID) of the applicant.
    https://developer.ww.wp.xz.cn/reference/functions/wp_get_post_parent_id/

    Regards,

    Thread Starter Jan

    (@krugmedien)

    Hi kashifrai,
    Hi PressTigers,

    thanks to both of you for the answers. That helps alot.
    Have a great day!

    Jan

    Arsalan Ahmed

    (@arsalanahmed901)

    Hi @krugmedien,

    We are glad to hear that your issues have been resolved.

    Feel free to reach out for further assistance.

    Regards,

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Insert Job Details into E-Mail’ is closed to new replies.