Contact Form 7 If Condition

Yes, you should be able access the form fields and field values with event.detail.inputs in addEventListener on wpcf7mailsent. You can then use the field values in the conditional statements and add the redirects you need. There’s a simple code sample in the plugin doumentation, https://contactform7.com/dom-events/, for looping the fields. EDIT Here’s a code example, document.addEventListener( … Read more

Related Drop down list

You can do this with Conditional Contact Form 7 plugin, for each values in your first dropdown you need to create a corresponding dropdown field, `[select first-dropdown “chose a value” “value 1” “value 2”] [group dropdown-value-1] [select value-1-dropdown “chose option for value 1” “value 1a” “value 1b”] [/group] [group dropdown-value-2] [select value-2-dropdown “chose option for … Read more

Send email to multiple addresses on Contact Form 7, but exclude personal details on all but one

Contact Form 7 lets you set up multiple outgoing emails. Set the outgoing message for the ‘everyone-except-one’, and a 2nd outgoing message for ‘just-the-one’. And use the BCC feature to keep everyone’s email confidential. Info on how to do that is on the CF7 site and support forums…..which is where you should ask for support … Read more

Export Form Data to a CSV then send it as an attachment – contact form 7

There are a few things omitted in the above solution, like defining the most params of wp_mail. Also I didn’t want to send yet another concurrent email, but instead attach the csv directly to the mail that wpcf7 sends. I think this is the cleaner solution. Here’s my take: add_filter( ‘wpcf7_before_send_mail’, ‘add_form_as_attachment’, 10, 3 ); … Read more

CF7 Ajax isn’t working when called inside WooCommerce “woocommerce_before_add_to_cart_button” hook [closed]

I am not sure when the woocommerce_before_add_to_cart_button action fires in the request sequence, but it could be worth adding the following code to your functions.php to see if it loads the CF7 js script files, add_action(‘wp_enqueue_scripts’, ‘pre_register_cf7_files’); function pre_register_cf7_files(){ wp_register_style(‘contact-form-7’, wpcf7_plugin_url( ‘includes/css/styles.css’ ), array(), WPCF7_VERSION, ‘all’ ); wp_register_script( ‘contact-form-7’, wpcf7_plugin_url( ‘includes/js/scripts.js’ ), array( ‘jquery’ ), … Read more