In previous versions of ChronoForms you could make a form with a radio list or a pull down that let the user pick a recipient by department or some other name and then in custom code you could define what the email address was.
Then in the email block you would set the "DynamicTo" to say email_to_use (based on the code below). But when I look at all of the options in an Email node in V6 there is no such thing as a DynamicTo.
How is this done in V6 now?
The custom code looked like this assuming in the form you populated 'recipient' with the selected radio button or option list value:
$recipient = JRequest::getString('recipient', '', 'post');
$emails = array('dept1'=>'joe@here.org',
'dept2'=>'mary@here.org',
'dept3'=>'jan@here.org'');
$form->data['email_to_use'] = $emails[$recipient];
$desttype = array('dept1'=>' Sales Question',
'dept2'=>'Refund Request',
'dept3'=>'Technical Request');
$dest = $desttype[$recipient];
$fname = JRequest::getString('fname', '', 'post');
$lname = JRequest::getString('lname', '', 'post');
$fullname = $fname.' '.$lname;
$form->data['fullname'] = $fullname;
$subject = JRequest::getString('subject', '', 'post');
$subject = '[PrefixText] ('.$dest.') '.$subject;
$form->data['subject'] = $subject;
Then in the email block you would set the "DynamicTo" to say email_to_use (based on the code below). But when I look at all of the options in an Email node in V6 there is no such thing as a DynamicTo.
How is this done in V6 now?
The custom code looked like this assuming in the form you populated 'recipient' with the selected radio button or option list value:
$recipient = JRequest::getString('recipient', '', 'post');
$emails = array('dept1'=>'joe@here.org',
'dept2'=>'mary@here.org',
'dept3'=>'jan@here.org'');
$form->data['email_to_use'] = $emails[$recipient];
$desttype = array('dept1'=>' Sales Question',
'dept2'=>'Refund Request',
'dept3'=>'Technical Request');
$dest = $desttype[$recipient];
$fname = JRequest::getString('fname', '', 'post');
$lname = JRequest::getString('lname', '', 'post');
$fullname = $fname.' '.$lname;
$form->data['fullname'] = $fullname;
$subject = JRequest::getString('subject', '', 'post');
$subject = '[PrefixText] ('.$dest.') '.$subject;
$form->data['subject'] = $subject;