I've searched the forums, and tried following FAQ 31 but i don't understand what to do. I've created the form layout in the wizard with a drop box containing three selections "Office" "Webmaster" and "Maintenance" but I have no idea how to define those variables as email addresses in the PHP where the form will be sent to the selected place. any help you can give will be wonderful as I have been fussing with this for about 4 hours now.
I'm sure some of you have done this before.. just take a minute a help please. I'm following FAQ 31. i have the HTML piece inserted and configured. but where do i define the email addresses in the php?
<?php
$MyForm =& CFChronoForm::getInstance('form_name_here');
$MyFormEmails =& CFEMails::getInstance($MyForm->formrow->id);
$MyFormEmails->setEmailData(1, 'to', $emails_2[$_POST['recipients']]);
?>
<?php
$MyForm =& CFChronoForm::getInstance('form_name_here');
$MyFormEmails =& CFEMails::getInstance($MyForm->formrow->id);
$MyFormEmails->setEmailData(1, 'to', $emails_2[$_POST['recipients']]);
?>
Well its been fun. but your supportless, way overly complicated extension is going to the trash bin. Thanks for the lack of help
Hi manchu0017,
Sorry, we get to sleep sometimes so the support isn't always instantaneous. And you are quite right, there is a piece missing from the latest snippet in the FAQ (though it's there a couple of lines down). Here's how it should read, I'll go an dcorrect it now.
We found a way to do this in two parts. First include the following in your Form HTML:
. . .
Select the recipient you wish to contact:
. . .
Then enter this code in the 'On Submit code - before sending email' field (For ChronoForms 3.1 and later):
Bob
Sorry, we get to sleep sometimes so the support isn't always instantaneous. And you are quite right, there is a piece missing from the latest snippet in the FAQ (though it's there a couple of lines down). Here's how it should read, I'll go an dcorrect it now.
We found a way to do this in two parts. First include the following in your Form HTML:
. . .
Select the recipient you wish to contact:
<select name="recipients">
<option value="em1">Name 1</option>
<option value="em2">Name 2</option>
<option value="em3">Name 3</option>
. . .
</select>
. . .
Then enter this code in the 'On Submit code - before sending email' field (For ChronoForms 3.1 and later):
<?php
$emails_2 = array('em1'=>'sample1@email.com', 'em2'=>'sample2@email.com', 'em3'=>'name_3@example.com', . . .);
$MyForm =& CFChronoForm::getInstance('form_name_here');
$MyFormEmails =& CFEMails::getInstance($MyForm->formrow->id);
$MyFormEmails->setEmailData(1, 'to', $emails_2[$_POST['recipients']]);
?>
Bob
This topic is locked and no more replies can be posted.