I'm migrating CF 3.2 forms to CF 4.
I have this custom before email code:
I get this error on CF4.
Has this class been renamed in CF4?
Jacob
I have this custom before email code:
$MyFormEmails =& CFEMails::getInstance($MyForm->formrow->id);
I get this error on CF4.
Fatal error: Class 'CFEMails' not found
Has this class been renamed in CF4?
Jacob
Hi jhdesign,
Yes, just about every variable and class name changed. Mas did a pretty complete re-write.
What are you trying to do? Is this to enable a email depending on form data?
Bob
Yes, just about every variable and class name changed. Mas did a pretty complete re-write.
What are you trying to do? Is this to enable a email depending on form data?
Bob
The form gets contactid from URL, fetches email and sends email to custom address. Here's the full code:
$db =& JFactory::getDBO();
$query = "SELECT email_to FROM #__contact_details WHERE id=".$_POST['contactid'];
$db->setQuery($query);
$jEmail=$db->loadResult();
$MyForm =& CFChronoForm::getInstance('StaffContact');
$MyFormEmails =& CFEMails::getInstance($MyForm->formrow->id);
$MyFormEmails->setEmailData(1, 'to', $jEmail);
Hi jhdesign,
A little simpler in CFv4. Use a Custom Code action before the Email action and put something like this in the code box:
Then use {jEmail} in the Email Dynamic To Email box
Bob
A little simpler in CFv4. Use a Custom Code action before the Email action and put something like this in the code box:
$db =& JFactory::getDBO();
$query = "
SELECT `email_to`
FROM `#__contact_details`
WHERE `id` = '{$form->data['contactid']}' ;
";
$db->setQuery($query);
$form->data['jEmail'] = $db->loadResult();
?>
Then use {jEmail} in the Email Dynamic To Email box
Bob
This topic is locked and no more replies can be posted.