In my form I can choose a certain region - AB, BC, SASK, MAN (they are currently set as check boxes) When I choose a region and fill out the form I want that region to get the email. So If I choose AB as my region then the form will get sent to ab@email.com. If I choose AB and BC as my region then the form will get sent to ab@email.com and bc@email.com.
am I able to do this by somehow setting the variables in the "Dynamic" part of the send email event?
Thanks
Penny
am I able to do this by somehow setting the variables in the "Dynamic" part of the send email event?
Thanks
Penny
Hi Penny,
This is tricky in CFv4 because I think I'm correct in saying that the standard Email action won't send to a list of addresses using the Dynamic To box. If you get my custom Email [GH] action that should work OK
For the basic code to set this up please see this FAQ
Bob
This is tricky in CFv4 because I think I'm correct in saying that the standard Email action won't send to a list of addresses using the Dynamic To box. If you get my custom Email [GH] action that should work OK
For the basic code to set this up please see this FAQ
Bob
Bob,
Thanks for your reply. I installed the action through the Chronoforms action tab and it said that it installed successfully.
The directions that you added are unfortunately not that clear. I am going to assume that I am to use the email [GH] action in the Onsubmit.
These are the setting that I have
[attachment=0]email.jpg[/attachment]
[attachment=1]email1.jpg[/attachment]
Thanks for your reply. I installed the action through the Chronoforms action tab and it said that it installed successfully.
The directions that you added are unfortunately not that clear. I am going to assume that I am to use the email [GH] action in the Onsubmit.
These are the setting that I have
[attachment=0]email.jpg[/attachment]
[attachment=1]email1.jpg[/attachment]
I noticed an error in my PHP code and have fixed it to be the following
<?php
$recipient = JRequest::getString('recipients', 'em1', 'post');
$emails = array (
'em1' => 'aaa@domain.com',
'em2' => 'v.bbb@domain.com',
'em3' => 'b.ccc@domain.com',
'em4' => 'ddd@domain.com' );
$form->data['email_to_use'] = $emails[$recipient];
?>
Hi Penny,
I can't see from here what option values you have in the drop-down and you don't seem to have edited the PHP to account for the need to send to more than one email address in some cases?
Please drag a Debugger action into the On Submit event, then submit the form and post the debug - including the 'dummy emails' results here.
Bob
I can't see from here what option values you have in the drop-down and you don't seem to have edited the PHP to account for the need to send to more than one email address in some cases?
Please drag a Debugger action into the On Submit event, then submit the form and post the debug - including the 'dummy emails' results here.
Bob
Hi Penny,
As you can see in the Debug output the email_to_use variable is empty. This is probably because you've switched to use a multi-select checkbox group but haven't updated the Custom Code to work with the array that this returns - you can see the values that has in the Debug Ouput.
Bob
As you can see in the Debug output the email_to_use variable is empty. This is probably because you've switched to use a multi-select checkbox group but haven't updated the Custom Code to work with the array that this returns - you can see the values that has in the Debug Ouput.
Bob
Oh dear.. I feel like this is becoming confusing...
So this is my set up.
I have a a group text box
Field Name and Field ID are set to "recipients"
in the options I have
On my Events - On Submit (in Order)
Show Thanks Message
Custom Code - Mode is Controller
Email [GH] - Enabled
Check Captcha
Debugger
So this is my set up.
I have a a group text box
Field Name and Field ID are set to "recipients"
in the options I have
em1=Colombie-Britannique
em2=Alberta
em3=Saskatchewan
em4=Manitoba
On my Events - On Submit (in Order)
Show Thanks Message
Custom Code - Mode is Controller
<?php
$recipient = JRequest::getString('recipients', 'em1', 'post');
$emails = array (
'em1' => 'email1@email.com',
'em2' => 'email2@email.com',
'em3' => 'email3@email.com',
'em4' => 'email4@email.com' );
$form->data['email_to_use'] = $emails[$recipient];
?>
Email [GH] - Enabled
To Field is - email_to_use
Check Captcha
Debugger
This topic is locked and no more replies can be posted.