The Participants Database Email Expansion Kit can be used to set up a contact form or other email that has a dynamic recipient. Most of the time, you will want to be able to route an email to a selected recipient without showing the actual email addresses.
As an example, lets say you have a Participants Database signup form that needs to send a notification to a recipient depending on a selected value. For simplicity, you have a dropdown that chooses the department that email needs to go to: Complaints, Orders, Tech Support. You don’t want people to email any of these folks directly, and besides, you might want to change who gets the emails, or have the email go to several recipients.
Here’s How to Set That Up
You’ll need to create a dropdown field that shows the options. Let’s name it “recipients” and give it the list of options in the “values” field for the field:
Complain about something::complaints,Ask about an Order::orders,Tech Support Request::techsupport
Now, in the email template, in the recipient field, put the “value tag” for that field:
So, when the signup form is used, the value the user selected will come in as the email recipient, but it’s not an email address yet. To make that happen, we need a filter that looks at the submitted value and substitutes it with the real value: the email address. Here is how that is done:
What is happening is the full list of all the tags comes into the function, but we are only interested in the one for our “recipients” dropdown. We look at that value and provide the real value (the email address) which will be used when sending the email.
Notice that when someone complains, the email goes to marketing and the CEO (as it should!) This is how you can assign multiple email addresses as a recipient.
It’s also possible to change the recipient based on other values in the tag list.