Forums

Event Switcher to different Email account based on field selection

tenspiderfingers 17 Apr, 2022
What is the procedure to recreate Event Switcher in v6 to send email to different addresses based on the value of a radio field?

Being a novice user who barely manages to make functional forms with v6, I am very frustrated trying to upgrade from v6 to v7 as I have to recreate all forms from scratch with little to none instructions.

Please help!
Colnem 18 Apr, 2022
Answer
Hi

There are several soluces:
1 - You an use an Action/Advanced/php to read the radio data, and set different email in a data:adress
2 - You can use a View/variable with Behaviors/Data/Run Condition for each radio:data to create a data:address.
3 - You can use an Event + Javascript in validation to set a data:address according to the data radio.
4 - You can create an array emails(radio_data1=>email1, radio_data2=>email2, …) then build your email adress like email[data:adress]= emails[radio_option]).

May be other soluces...
pgrnycomdir 16 Oct, 2022
Colnem,

I have this same issue and am struggling here.

I have a radio drop down with 9 choices. Based on the selection there are two different email addresses for the form information to be sent.

So for selection 1 it equals email address A and email address B. How do I write this???

I used switches in CF6. I am not finding how to do this and write it correctly in CF 7,

Can you or anyone assist with this. I tried to write conditions and it did nothing.

(I was going to load an image but I can't even get that to work on this forum.)

Thank you in advance.
Donna
Colnem 17 Oct, 2022
Hi

In you radio field, you can do that;

Value1= adress_1, Text=Option 1
Value2= adress_1, Text=Option 2
Value3= adress_1, Text=Option 3
....
Value 6= adress_2, Text=Option 6
Value 7= adress_2, Text=Option 7
Value 8= adress_2, Text=Option 8
Value 9= adress_2, Text=Option 9


So, {data:radio_field_name} will give the good adress.

Bye
GreyHead 17 Oct, 2022
Hi Donna,

Basically I agree with Colnem's suggestion. But you should be careful putting email addresses into the form HTML as they may be scraped and spammed. Better to leave the values as the digits 1-6 and use custom code On Submit to look up the corresponding email address.

Bob
pgrnycomdir 17 Oct, 2022
GreyHead,

And how would I create the custom code and where does it go? My first page has the SUBMIT, then where and how would I put the values equal information? The End Page or in the Settings? I have no clue, but if I can get one form that requires this working, then I can get the rest working as well.

That's my biggest problem, no manual and for some of us this information is not intuitive. I mean, I'm getting by only by the seat of my pants and help from you folks!

Again, thank you in advance!
Donna
pgrnycomdir 17 Oct, 2022
Thank you Colnem. Now I just need to figure out where this information should go based on GrehHead's comments. I sure do not want to cause issues with spam.

Donna
Colnem 18 Oct, 2022
In your radio group, you can replace address1 by 1, address2 by 2.
Wihout PHP, you can use 2 action variables like this:
1)
Variable 1: Request Data, name=email_address, value=adress1
In behavior, you have to use Run Conditions with {data:radio_field_name} == 1

2)
Variable 2: Request Data, name=email_address, value=adress2
Run Conditions with {data:radio_field_name} == 2

You can also use a PHP acton if you know PHP language.

Bye
pgrnycomdir 18 Oct, 2022
I think it's a bit more complicated.

My radio buttons are values:

1=Region 1
2=Region 2
and so on.

Then value 1 = email addresses of xxxx@pgrny.org and email address xxxx@gmail.com

Therefore I really don't know how to write that, nor where to put it. According to GreyHead if I put actual addresses in the dropdown they can be scraped and I can get spam, which I obviously don't want to do.

I hate to be so stupid here, but there are those of us who do not understand where to put this information. In the dropdown area, or in the set-up of the form. How to you get to a box where anything can be written in? None of this is making any sense to me.

In CF6, you would write a switch with variables. I don't see how I can do anything close to that in CF7.

Sorry for not understanding.

Best regards,
Donna
pgrnycomdir 26 Nov, 2022
Colnem,

I am trying to add the variables and conditions so the system knows what email addresses to use. This is based on your response to this particular question. If I can only add one address per value, that's fine, I'll manually do the others.

What I am struggling with is the following:
  1. Where to I put the variables and conditions? Do they go in a group that contains the radio field in the first page of the form or do they go on the end page? And if on the end page, where?
  2. What do I use for the email address in the ACTION on the end page, the group name?
Please help. I know you sent me the php in a PM but I have no idea what that is saying or how to edit based on what I am doing. It was so easy in CF 6 and easy to understand.

Best regards,
Donna
pgrnycomdir 25 Jan, 2023
Vdneut,

Max_Admin was replying to me with this 'solution'. I tried it for a dropdown with 9 different values. The email addresses for the values are gmail, aol, yahoo, etc., and unfortunately it did not work for me. I was wondering if it had something to do with the emails being other than domain email addresses.

And equally unfortunate is that I have not gotten any answers from anyone or any further assistance.

Best regards,
Donna
vdneut 25 Jan, 2023
Hi Donna,

Have you tried it with one email address per dropdown option? I made some screenprints (it's in Dutch 'Aan' = 'To'). Maybe it will help to take the first step: make it work for one email address per dropdown option. As you can see, you can use any email address, regardless of the domain.
If this works, you can try to enter more than one email address in the 'New value' column. Something like: first@hotmail.com;second@gmail.com
I did not test it, but I guess CF7 just copies the value in the To (Aan in my example) field that will be used in the Email part of the form.




Kind regards,
Nico
pgrnycomdir 27 Jan, 2023
Nico,

Thank you so very much!!! Now that it was made clear where to put the email, it worked like a charm.

Too bad it won't work with multiple addresses. As I need that as well. Guess I will have to do some of what Chronoforms 6 did manually because CF 7 won't do it.

Best regards,
Donna
You need to login to be able to post a reply.