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
}
?>
Hi schlogo ,
All of this code has chaned in CFv4. If you use my Email [GH] action then it has a built in 'condition' box that you an use to turn individual emails on and off. That might be the easiest answer here.
Bob
PS Otherwise I'm working on a 'Switcher' action that lets you activate different events depending on the from results. But that seems more than you need here.
All of this code has chaned in CFv4. If you use my Email [GH] action then it has a built in 'condition' box that you an use to turn individual emails on and off. That might be the easiest answer here.
Bob
PS Otherwise I'm working on a 'Switcher' action that lets you activate different events depending on the from results. But that seems more than you need here.
Just a note, starting from V4 RC3.0, you can dynamically enable/disable ANY action with this code:
The one should be set to "0" if you want to "Disable".
And the "ACTION_ID" is something like: "email_x", where "x" is the action order number shown in red in the wizard.
Regards,
Max
<?php
$form->set('ACTION_ID', 'enabled', 1);
?>
The one should be set to "0" if you want to "Disable".
And the "ACTION_ID" is something like: "email_x", where "x" is the action order number shown in red in the wizard.
Regards,
Max
This topic is locked and no more replies can be posted.
