How do I setup multiple recipients or recipients based on selection ?
1. To setup multiple recipients, just go to the desired email tab (User Email or Admin Email) and enter multiple recipients separated by a comma (,) like this:
john.dorian@mywebsite.com,webmaster@mywebsite.com,postmaster@mywebsite.com
2. If you want to setup a recipient based on user's selection, try this:
Let's assume that your radio group form component is named "radio".
- The items of this form component will have to look similar to this:
john.dorian@mywebsite.com|John Dorian webmaster@mywebsite.com|Webmaster Account postmaster@mywebsite.com|Postmaster Account
- In the Admin Email tab, just fill in the To field with the following syntax:
{radio:value}
Note:
- The above example is for only one recipient. If you want multiple recipients per item, just enter them before the pipe (|), separated by a comma (,).
- You can use the {radio:text} placeholder in the User / Admin Emails text to return the label of the select items (e.g. John Dorian).
3. If you are using the same email address across multiple items, you'll need to use a script in "PHP Email Scripts" that will control the "To" field based on the user's selection, for example:
if($_POST['form']['name_of_drop_down'][0] == 'Option1') $adminEmail['to'] = 'email1@domain.com'; if($_POST['form']['name_of_drop_down'][0] == 'Option2') $adminEmail['to'] = 'email2@domain.com';
If you have multiple options pointing to the same email address, you can use something similar:
if($_POST['form']['name_of_drop_down'][0] == 'Option1' || $_POST['form']['name_of_drop_down'][0] == 'Option3') $adminEmail['to'] = 'email1@domain.com';
Keep in mind that the field items needs to be unique, similar to:
- |Please select...
- Option1
- Option2
- Option3
- ...
67 persons found this article helpful.