• Resolved wolfsteritory

    (@wolfsteritory)


    I need to add an option to the job manager plugin using the bulk action from the WordPress to select resumes and create a mailto link to mail to multiple candidates, the output link need to be something like this:

    > mailto:[email protected],[email protected],[email protected]

    I got this to start with:

    `
    /**
    * Email Candidates
    */

    add_filter( ‘bulk_actions-edit-resume’, ‘register_my_bulk_actions’ );

    function register_my_bulk_actions($bulk_actions) {
    $bulk_actions[’email_to_eric’] = __( ‘Email to Eric’, ’email_to_eric’);
    return $bulk_actions;
    }

    add_filter( ‘handle_bulk_actions-edit-resume’, ‘my_bulk_action_handler’, 10, 3 );

    function my_bulk_action_handler( $redirect_to, $doaction, $post_ids ) {
    if ( $doaction !== ’email_to_eric’ ) {
    return $redirect_to;
    }
    foreach ( $post_ids as $post_id ) {
    // Perform action for each post.

    if ( $email = get_post_meta( $post->ID, ‘_candidate_email’, true ) ) {
    $admin_actions[’email’] = array(
    ‘action’ => ’email’,
    ‘name’ => __( ‘Email Candidate’, ‘wp-job-manager-resumes’ ),
    ‘url’ => ‘mailto:’ . esc_attr( $email )
    );

    }
    $redirect_to = add_query_arg( ‘bulk_emailed_posts’, count( $post_ids ), $redirect_to );
    return $redirect_to;
    }`

    I have no idea where to go from here. I can’t use a general email plugin because I have multiple resumes added to the database by the HR staff( who opted not to create a new account for each candidate as I instructed).

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Wp Bulk Action send Email’ is closed to new replies.