Set a Recipient email based on two dropdown values
-
I have a two dropdown in from. Investment and State. Based on these two values I want to change the Recipient mail address. But Not sure How to get those values.
Here Is a bit of code I have tried. But submit form gives an error.
function wpcf7_do_something (&$WPCF7_ContactForm) {
if ($form->id() == 3851) ://Not sure How can I get The data of this investment & State Dropdown. Based on
if ($WPCF7_ContactForm->posted_data[‘Investment’] == “15-20 lack” && $WPCF7_ContactForm->posted_data[‘State’] == “Gujarat” ) {
$WPCF7_ContactForm->mail[‘recipient’] = “Name <[email protected]>”;
}
endif;}
add_action(“wpcf7_mail_components”, “wpcf7_do_something”);
- The topic ‘Set a Recipient email based on two dropdown values’ is closed to new replies.