Skip to content

Instantly share code, notes, and snippets.

@REPTILEHAUS
Created February 25, 2017 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save REPTILEHAUS/78cb34d00ae0724534dd7e4b9218ce6e to your computer and use it in GitHub Desktop.
Save REPTILEHAUS/78cb34d00ae0724534dd7e4b9218ce6e to your computer and use it in GitHub Desktop.
<?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