Forums

Chronoforms 8: How to switch teh email address based on a field value

spytech 08 Sep, 2024

Hi,

How do I set the recipients field to pickup the email address based on a selection of another field?

I have a field, field name: contact_type

If they select option 1, then I want to send an email to abc@xyz.com

If they select option 2, then I want to send an email to 123@xyz.com

What do I add in the Recipients field and do I need to add anything else to the form seeing as there is no Switcher feature?

v.d. Hulst 11 Sep, 2024
1 Likes

Hello Spytech,

That is not so difficult.

Example with a dropdown list:

Set this in the options of a dropdownlist

Label: Choose receiver

Field name: lbreceiver

Options:

=Choose the receiver you want...

abc@xyz.com=Receiver 1

123@xyz.com=Receiver 2

Behaviour: Required

In the email:

Recipients: {data:lbreceiver}

{data:lbreceiver} will be abc@xyz.com or 123@xyz.com depending on the selection.

In the body of the email e.g.

The email is sent to: {var:lbreceiver.selection}

(in the email {var:lbreceiver.selection} is replaced by Receiver 1 or 2 depending on the selection)

Hope this helps you.

Regards,

Peter

You need to login to be able to post a reply.