Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @jaegerms

    Thx for the reply. I managed to solve the problem without the plugin and adding a function to the plugin. I will just leave it here in case someone else need it in the future.

    function check_mail_send_contactform($cf7) {
    $submission = WPCF7_Submission::get_instance();
    if ( $submission ) {
    $posted_data = $submission->get_posted_data();
    }
    $mail = $cf7->prop( ‘mail’ );

    if($posted_data[‘newsletter’][0]) {
    $mail2 = $cf7->prop( ‘mail_2’ );
    $mail2[‘recipient’] = $posted_data[‘your-email’];
    $cf7->set_properties( array( ‘mail_2’ => $mail2 ) );
    }
    return $cf7;
    }
    add_action(‘wpcf7_before_send_mail’,’check_mail_send_contactform’);

    Cheers

    Hi @jaegerms

    I am wondering if you have found a way to do it without hiding the email field with conditional fields plugin? My website functionality is exactly the same as yours. I would like user to be able to choose whether to receive a booklet or not.

    Would you be able to share your solution?
    Thx

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