In the past I would assign an email address by putting the following code in the "On Submit code - before sending email" box:
<?php
$emails_2 = array('General Question'=>'reception@rosmini.school.nz', 'Absentees'=>'recept@school.nz','Enrolments'=>'if@school.nz','Sports'=>'sport@rosmini.school.nz','International'=>'int@school.nz','Accounts'=>'acc@school.nz','IT'=>'adm@school.nz');
$MyForm =& CFChronoForm::getInstance('ContactUs');
$MyFormEmails =& CFEMails::getInstance($MyForm->formrow->id);
$MyFormEmails->setEmailData(1, 'to', $emails_2[$_POST['subject']]);
?>
What I've tried to do in V4 is add this to a custom code event (as shown in the attached image).
This however results in the following error:
Fatal error: Class 'CFEMails' not found in /var/www/vhosts/school.nz/subdomains/upgrade/httpdocs/administrator/components/com_chronoforms/form_actions/custom_code/custom_code.php(18) : eval()'d code on line 4
Obviously something has changed but alas I know not what.