How to execute a server side script when contact form 7 is submitted? [closed]
You need wpcf7_before_send_mail hook that gets triggered after sending email successfully. Just add this in your functions.php. add_action( ‘wpcf7_before_send_mail’, ‘process_contact_form_data’ ); function process_contact_form_data( $contact_data ){ var_dump($contact_data->posted_data); $name = $contact_data->posted_data[“your-name”]; $email = $contact_data->posted_data[“your-email”]; echo $name ; echo $email; } You can access fields by their name in $contact_data->posted_data array. Yes. You can redirect to another page … Read more