Forums

Email Distribution

pgrnycomdir 10 Dec, 2022
I am still struggling to get emails to go to different email addresses based on selection values of either radio or drop-down menu values.

I apologize in advance as I am NOT a programmer and do not understand PHP.

But, can I use LOCAL VARIABLES in the EMAIL ACTION to send to different email addresses based on values selected for a field?

If yes, exactly how would I write the LOCAL VARIABLES?

DROPDOWN field name: REGION
Values are 1 through 9, each value has a different email address associated with it.

I want to look at the {data:region} and if it equals value [1], then have it go to abc@gmail.com
If {data:region} and if it equals value [2, then have it go to xyz@gmail.com

And so on.


I would certainly appreciate someone explaining this in layman's terms so I can get these last 3 forms up and working in CF7 so I can update to PHP 8. In CF6, I used a SWITCH and emailed recipient: SWITCH. Since there is no Switch in CF7 I would greatly appreciate some simple instructions so that I could follow it for the remaining forms I have to get done.

Best regards,
Donna
JosHe 11 Dec, 2022
Hi Donna,
I'm not that familiar with PHP neither but you can select the checkbox outcome in the recipients list (drop down) field from the default mail function in the actions editor area of e.g. page 2 from your form(s) without performing special PHP coding yourself, don't you?
Best Regards,
Jos
pgrnycomdir 12 Dec, 2022
Hi JosHe,

I'm really not sure what you mean. I want the system to choose the correct email based on a selection from the drop-down or radio button, and in my case there are 9 choices. Those values are equal to a particular email address. Once the user selects the option, I want the system to read the data selected and then send to the appropriate email address. Therefore those emails will not be in the recipient drop-down on email action as they are not form fields.

Thank you for your reply.
Donna
You need to login to be able to post a reply.