In version 3 I was able to set the e-mail address depending on the subject of the e-mail by setting the following code in the "onSubmit Events Code" section
Where do I do this in Version 4 and is there any changes that I need to make to the above code?
<?php
$emails_2 = array('General Question'=>'reception@x.school.nz', 'Absentees'=>'reception@x.school.nz','Enrolments'=>'ifairhurst@x.school.nz','Sports'=>'sports@x.school.nz','International'=>'international@x.school.nz','Accounts'=>'accounts@x.school.nz','IT'=>'admin@x.school.nz');
$MyForm =& CFChronoForm::getInstance('forms_contactus');
$MyFormEmails =& CFEMails::getInstance($MyForm->formrow->id);
$MyFormEmails->setEmailData(1, 'to', $emails_2[$_POST['subject']]);
?>
Where do I do this in Version 4 and is there any changes that I need to make to the above code?
This topic is locked and no more replies can be posted.