i am using contact form 7 and i want to send contact form data to my sheet
below the code to get contact form data
add_action( 'wpcf7_mail_sent', 'your_wpcf7_mail_sent_function' );
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();
}
if ( 'Contact form' == $title ) {
$yourName = $posted_data['your-name'];
$yourEmail = $posted_data['your-email'];
$yourPhone = $posted_data['phone'];
}
}
How can i send contact form data to my sheet?
Now I have done.