Forums

Drop Down Menu to select Recipient Email

Stush 03 Dec, 2015
Good afternoon, I am building a form where a selection in a drop-down menu changes which email address the form is sent to, is there a simple way to do this in V5? We used to use a custom email action in V4 for it, but since 5 is so different I don't think the same method would work. If you guys could give me a point in the right direction that'd be great, thankyou.
GreyHead 03 Dec, 2015
Answer
Hi Stush,

In CFv5 you can add an input name to the Dynamic To Email box on the Advanced tab of the Email action. If you set the email in the same way as for CFv4 that should work OK.

Bob
Stush 11 Dec, 2015
Sorry about not replying earlier, started work on another project and only just got back to this. Worked great, set the email addresses as values in a dropdown, made the Dynamic To have the alias of the dropdown, it works perfectly.

One thing i'll point out, incase anyone else wants to do this, it doesn't like having multiple options with the same value/email address, which makes sense, as it uses the value to keep track of the options, like an alias. So if you have multiple options that go to the same email address, you might need to consolidate them.
GreyHead 11 Dec, 2015
Hi Stush,

I generally recommend that you don't make use the email addresses as the values in a drop-down, that simply because if you do they are show in the page HTML - though not visible to human users - and may be be scraped and spammed.

Better to use a 'short-code' as the value e.g. john, peggy, sales, admin and look up the full address after the form submits.

Bob
Stush 14 Dec, 2015
Hm, that's a good point, Do you have any resources I could look at for how to use a "Short code" to convert to a full address after submit? Sorry, I haven't done this before.
GreyHead 14 Dec, 2015
Hi Stush,

Please see this FAQ. By short code I just mean a text string that identifies the address you want to use later. Can be em1 as in the FAQ, or a name or a department, or region or . . .

Bob
Stush 15 Dec, 2015
Thanks, this works great! You do great work.
This topic is locked and no more replies can be posted.