Variable body message based on dropdown value in form
-
Hey all,
I have an event registration form that has a required dropdown with timezone values.
When the user submits the form I want to send them an email with times of the event but the information sent back is dependant on the value of the dropdown.
So for example in the email body we need something like
if($timezone == 'GMT'){ add GMT times to body of email } if($timezone == 'PST'){ add PST times to body of email }I have been trying to use the following function
add_action( 'wpcf7_mail_sent', 'my_wpcf7_mail_sent_function' ); function my_wpcf7_mail_sent_function( $contact_form ) { $title = $contact_form->title; $submission = WPCF7_Submission::get_instance(); if ( $submission ) { $posted_data = $submission->get_posted_data(); } $firstName = $posted_data['your-name']; echo 'aaaa'.$firstName; }But I am not getting any result, this code causes the form to hang.
Any help would be appreciated.
Thanks
Andy
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Variable body message based on dropdown value in form’ is closed to new replies.