I have a dropdown with values of:
Zone1
Zone2
Zone3
I want to have the ability to send an email to a different address depending on what zone is selected. How would I do that?
Hi bneese,
Please see FAQ #31.
Bob
I read FAQ 31, but I am not sure it does what I want. When a user selects Zone1 I need that data sent to the database as zone1, but I need an email going to the leader of zone1 via their email address. I am not sure how I would format that.
Actually, maybe I see the way it is done.
Let me give it a try.
I get the following error message:
You must provide at least one recipient e-mail address.
If I take out the custom code it sends correctly.
I got it working.
OK, I want to take that same code, but also send an email to the person who submitted the form to their email address.
<?php
$emails_2 = array('Zone 1'=>'xxxxxxx', 'Zone 2'=>'xxxxxxx', 'Zone 3'=>'name_3@example.com');
$MyForm =& CFChronoForm::getInstance('ActionCommitteeCom');
$MyFormEmails =& CFEMails::getInstance($MyForm->formrow->id);
$MyFormEmails->setEmailData(1, 'to', $emails_2[$_POST['zone']]); <-- how can I add the field email to this so an email is sent to the zone address above and the field called email on the form?
?>
How would I add the CC field to this? I tried adding:
$MyFormEmails->setEmailData(1, 'cc', $emails_2[$_POST['email']]);
But it didn't work.
Hi bneese ,
Add a separate Dynamic To element to the Email Setup to send a copy to the user. (Or use a second separate Email Setup with a different message.)
Bob