New syntax for $posted_data
-
I try to dynamically set the recipient of a form according to the value of a drop down. I found this code that seems to be outdated and also other posts related to the syntax for this code. It sends the e-mail to ‘else’ conditions regardless of the option selected.
I couldn’t find documentation on the docs.
What is the new way of getting the posted data?if ( $posted_data['enquiry-type'] == 'Option A' ) { // If General option is selected
$recipient_email = '[email protected]';
}
elseif ( $posted_data['enquiry-type'] == 'Option B
' ) { // else if Media option is selected
$recipient_email = 'yyy@mail
.fr';
}
elseif ( $posted_data['enquiry-type'] == 'Option C
' ) { // else if Jobs option is selected
$recipient_email = 'zzz@
mail
.fr';
}
else { // If no dropdown option is selected
$recipient_email = '[email protected]';
}// set the email address to recipient
$mailProp = $contact_form->get_properties(‘mail’);
$mailProp[‘mail’][‘recipient’] = $recipient_email;// update the form properties
$contact_form->set_properties(array(‘mail’ => $mailProp[‘mail’]));The page I need help with: [log in to see the link]
- The topic ‘New syntax for $posted_data’ is closed to new replies.