Forum
Sending form contents to different recipients based on field selection in a form
I have a simple contact form on a site. The client is requesting that the site visitor be able to choose the subject of their inquiry via a dropdown, and for the email to then go to a specific email address based on which subject is selected. So if a visitor filling out the form picks, "I need help with XYZ" the email gets sent to him@site.com, but if the question is "I'd like to return XYZ" the email gets sent to her@site.com.
Is that possible with the Form app?
Thanks!
Not with the Forms app, no.
Ok, thanks.
I got asked the same by a customer the other day, using the Form App. We solved it using the enquiry subject dropdown that you're using. All emails are being sent to the same address. The customer is setting up local filtering to search for the different preset subjects in the email body - and then auto-redirect the message to another email account within the organisation.
I've not tested this, but is it not possible to have the value in the options as the email addresses?
Like this:
and then in Form Options add {subject} as the email recipient.
I think the recipient would see their email address as the subject however.
I just tried Simon's suggestion and it seems to work perfectly.
I even added a repeater to give the client the possibility to add subjects—or names in my case—and e-mail addresses.
Then in Form Options I added {recipient} as the email address.
The <perch:if> part prevents an empty item at the end of the options, btw.