Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
function contactform7_before_send_mail( $form_to_DB ) {
global $wpdb;
$form_to_DB = WPCF7_Submission::get_instance();
if ( $form_to_DB )
$formData = $form_to_DB->get_posted_data();
$name = $formData['name'];
$wpdb->insert( 'wp_cf7_test', array( 'name' =>; $name ), array( '%s' ) );
}
remove_all_filters ('wpcf7_before_send_mail');
add_action( 'wpcf7_before_send_mail', 'contactform7_before_send_mail' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment