Hello
Working with V3, i was using the following code to enable and disable emails . I wanted to use the same piece of code in V4 but I can't get it to work. I get a blank page and the email is not sent.
Would someone know what i need to change ?
Tks !
Working with V3, i was using the following code to enable and disable emails . I wanted to use the same piece of code in V4 but I can't get it to work. I get a blank page and the email is not sent.
Would someone know what i need to change ?
Tks !
<?php
$MyForm =& CFChronoForm::getInstance('diagmanagement');
$MyFormEmails =& CFEMails::getInstance($MyForm->formrow->id);
$mailtype = $_POST['mailtype'];
if($mailtype == "1")
{
$MyFormEmails->setEmailData(1, 'enabled', '0');//enable email 1
$MyFormEmails->setEmailData(2, 'enabled', '1');//enable email 2
}
else
{
$MyFormEmails->setEmailData(1, 'enabled', '1');//disable email 1
$MyFormEmails->setEmailData(2, 'enabled', '0');//disable email 2
}
?>