• Trying to change the form submit action dependant on the form ID. I want the forms to submit directly to SugarCRM and avoid mail.

    currently I have:

    add_action( 'wpcf7_before_send_mail', 'wpcf7_disablEmail' );
    
    function wpcf7_disablEmail( $wpcf7_data ) {
    
    	if($wpcf7_data->id() === 1477):
    		$wpcf7_data->skip_mail = true;
    	endif;
    }
    
    add_filter( 'wpcf7_form_action_url', 'wpcf7_useSugar' );
    
    function wpcf7_useSugar( $url ){
    
    }

    How would I check the current form id with the above filter?

    https://wordpress.org/plugins/contact-form-7/

Viewing 1 replies (of 1 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    Try this in the wpcf7_useSugar() function.

    $current = WPCF7_ContactForm::get_current();
    $id = $current->id();

    Changing the action URL to SugarCRM means that Contact Form 7 won’t receive submissions through the form. So you no longer need to change skip_mail to true like you currently do using the wpcf7_before_send_mail action.

Viewing 1 replies (of 1 total)
  • The topic ‘change form action dependant on form ID’ is closed to new replies.