CF7 uses AJAX to submit forms and you can't see var_dump()
in ordinary way. So through PHP you can use WordPress debug.log file. Iside "wp-config.php" instead of define('WP_DEBUG', false);
write:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
Then:
add_action("wpcf7_before_send_mail", "wpcf7_do_something_else");
function wpcf7_do_something_else( &$WPCF7_ContactForm ) {
$name = $WPCF7_ContactForm->posted_data['your-name'];
ob_start();
var_dump($name);
$contents = ob_get_contents();
ob_end_clean();
error_log($contents);
}
As option you can do that in front-end with JS thru the CF7 DOM events
Example - when your form is submit:
<script>
document.addEventListener( 'wpcf7submit', function( event ) {
var inputs = event.detail.inputs;
for ( var i = 0; i < inputs.length; i++ ) {
if ( 'your-name' == inputs[i].name ) {
alert( inputs[i].value );
break;
}
}
}, false );
</script>