Forums

How to send email conditional

peter.wirth 12 Mar, 2014
Tank you for this great tool!

I try to send an email dynamicly. (How to send an Email dynamically)
The Code from CF V4 is not working any more.

<?php
if ( !empty($form->data['input_checkbox_1']) && ($form->data['input_checkbox_1'] == '1') ) {
$form->set("email_77", "enabled", 1);
}
?>

$form->set => gives an error!

Which new code we have to use with CF V5?

Peter
peter.wirth 13 Mar, 2014
There are no answers at the 4 topics above! I check all of them.
Max_admin 13 Mar, 2014
Hi Peter,

Correct, in v5 this line of code:
$form->set("email_77", "enabled", 1);

should be:
$form->actions_config[77]["enabled"] = 1;


Where 77 is the action id, its shown beside every action's title under the setup area!

So, if the line above is placed inside a "custom code" action BEFORE some action which is not enabled and has id 77, then the action will be enabled in runtime and will be processed.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
peter.wirth 13 Mar, 2014
Thank you! It's working well!
This topic is locked and no more replies can be posted.