Привет.
add_action( 'wpcf7_before_send_mail', 'wpcf7_process_data' );
function wpcf7_process_data() {
$submission = WPCF7_Submission::get_instance();
if ( $submission ) {
$posted_data = $submission->get_posted_data();
}
ob_start();
var_dump( $posted_data );
error_log( ob_get_clean() );
}
+ в wp-config.php:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
Более корректный вариант описан
тут:
add_action( 'wpcf7_before_send_mail',
function( $contact_form, &$abort, $submission ) {
$your_email = $submission->get_posted_data( 'your-email' );
$your_message = $submission->get_posted_data( 'your-message' );
// Do some productive things here
},
10, 3
);