test-from
add_action( ‘wpcf7_before_send_mail’, function( $contact_form, &$abort, $submission ) {
$your_name = $submission->get_posted_data( ‘your-name’ );
?>
get_posted_data( ‘your-name’ );
?>
title;
$submission = WPCF7_Submission::get_instance();
if ( $submission ) {
$posted_data = $submission->get_posted_data();
$name = $posted_data[‘your-name’];
$email = $posted_data[‘your-email’];
$subscriber = array(
’email’ => $name,
‘name’ => $email,
);
}
}
add_action( ‘wpcf7_before_send_mail’,
function your_wpcf7_mail_sent_function( $contact_form ) {
$title = $contact_form->title;
$submission = WPCF7_Submission::get_instance();
if ( $submission ) {
$posted_data = $submission->get_posted_data();
ob_start();
echo ‘
'; print_r($posted_data); echo '
‘;
$content = ob_get_clean();
wp_mail($your_mail, ‘Debug’, $content);
}
}
);
https://www.e-mini.com/wp-content/themes/emini/contact-data.php
function cf7_data()
{
$submission = WPCF7_Submission::get_instance();
$data = $submission->get_posted_data();
// Here I have a variable containing a field from the contact form
$subject = $data[‘your-name’];
// I don’t know what to do next
}
add_action(‘wpcf7_before_send_mail’, ‘cf7_data’);
document.addEventListener( ‘wpcf7mailsent’, function( event ) {
location = ‘https://www.e-mini.com/wp-content/themes/emini/contact-data.php’;
}, false );
////////////////////////////////////////////////////
add_action(‘wpcf7_mail_sent’, function ($cf7) {
$submission = WPCF7_Submission::get_instance();
if ($submission) {
$cf7_data = $submission->get_posted_data();
}
}
add_action( ‘wp_footer’, ‘redirect_cf7’ );
function redirect_cf7() {
?>
get_posted_data();
$sname = $data[‘your-name’];
function redirect_cf7() {
?>
get_posted_data( ‘your-name’ );
// Getting user input through the your-message field
$your_message = $submission->get_posted_data( ‘your-message’ );
// Do some productive things here
},
10, 3
);
add_action( ‘wp_footer’, ‘redirect_cf7’ );
function redirect_cf7() {
$abc = “tst”;
?>
id();
if($form_id == 2177 ){
// to get submission data $posted_data is asociative array
if ($submission) {
$submission = WPCF7_Submission::get_instance();
$cf7_data = $submission->get_posted_data();
$sname = $cf7_data[‘your-name’];
print_r ($sname);
?>
get_posted_data( ‘your-name’ );
// // Getting user input through the your-message field
// //$your_message = $submission->get_posted_data( ‘your-message’ );
// // Do some productive things here
// },
// 10, 3
// );
// add_action(‘wpcf7_mail_sent’, function ($cf7) {
// global $sname;
// $submission = WPCF7_Submission::get_instance();
// if ($submission) {
// $cf7_data = $submission->get_posted_data();
// $sname = $data[‘your-name’];
// ?>
//
// alert(“Welcome to Geeks for Geeks”)‘;
// }
// }
// );
// add_action( ‘wp_footer’, ‘redirect_cf7’ );
// function redirect_cf7() {
// $abc = “thanks”;
// ?>
//
//