Forums

Different email addresses depending on choice of dropdown

pgrnycomdir 29 Oct, 2022
I will attempt to ask my question again and be more clear about it this time.

I have a Dropdown where:

Value 1 if chosen, must be emailed to two separate email addresses
Value 2 if chosen, must be emailed to two other email addresses
Value 3 if chosen, must be emailed to two other email addresses
Value 4 if chosen, must be emailed to two other email addresses
Value 5 if chosen, must be emailed to two other email addresses
Value 6 if chosen, must be emailed to two other email addresses
Value 7 if chosen, must be emailed to two other email addresses
Value 8 if chosen, must be emailed to two other email addresses
Value 9 if chosen, must be emailed to two other email addresses

So as you can see each value choice has two separate email addresses. A total of 18 different emails, 2 email addresses for each choice of the dropdown.

The email addresses MUST be hidden so as not to be spammed or scraped.

I still do not understand where and how I would do this in Chronoforms 7.

This is obviously and Advanced Form. Is it in the EDITOR section of the form? Is it in the ACTIONS section of the form?

And further, is it a CONDITION? Is it a VARIABLE?

How do I write this? AND no, I do not write PHP.

I would really appreciate some step by step here. It used to be a lot easier with SWITCHES in CF 6.

Hopefully this post is clearer with what I am trying to do. My existing forms all do this in CF 6, and unfortunately I must now try to make it happen with CF 7.

Thank you to anyone who can help. I am beyond frustrated at this point.

Best regards and thank you in advance,
Donna
Colnem 30 Oct, 2022
Hi

The best is to use a PHP Action in your end page.
You have to build a data with the choice of the dropdown

The principle:
In php, write an array like

1=>array(0=>'address11',1=> 'address12')
2=>array(0=>'address21',2=> 'address22')
3=>array(0=>'address31', 3=>'address32')



You return the array of the choice. Example, if the choice is 7 you return array(7=>'address71', 3=>'address72')

Then you use this array to send your mail...
pgrnycomdir 30 Oct, 2022
Colnem,

Okay, I see where I can add PHP to the Actions in my End Page.

Now where or how to you ever tell in your example what 1 is?

My radio field name is region. The radio give values 1 through 9.

So how do I write the for my personal example? In other words where the do you give the definition of what array 1 is coming from what field?

I'm sorry I just don't understand.

Again, like I said, I do not know PHP coding.

Thank you
Donna
pgrnycomdir 30 Oct, 2022
OK, let me try and ask a different way.

How does the system know what the data provider is in the PHP action?
You need to login to be able to post a reply.