I've been asked to set something up on an existing Joomla installation.
If a user submits information that requires information to be emailed to him, then an email is sent.
If he doesn't then no email is sent.
I can't see how to disable the email.
There's a PHP array called "main_event_actions" which contains the following stdClass objects:
Array (
[0] => stdClass Object (
[id] => 1612
[chronoform_id] => 12
[type] => custom_serverside_validation
[enabled] => 1
[params] =>
[order] => 16
[content1] => {PHP code}
)
[1] => stdClass Object (
[id] => 1617
[chronoform_id] => 12
[type] => auto_serverside_validation
[enabled] => 1
[params] => {PHP Code}
[order] => 2
[content1] =>
)
[2] => stdClass Object (
[id] => 1613
[chronoform_id] => 12
[type] => custom_code
[enabled] => 1
[params] => mode=controller action_label=Classify Breed
[order] => 25
[content1] => {PHP Code} //<---- my custom code to verify the information submitted and to send the email (or not)
)
[3] => stdClass Object (
[id] => 1614
[chronoform_id] => 12
[type] => email
[enabled] => 1
[params] => {subject=Email from_email=noreply@royalcaninbreedersclub.com, etc, etc}
[order] => 20
[content1] => main_event_actions);
)
)
I've tried using this:
if(!$matches){
$breed='generic';
foreach($form->main_event_actions as $action => $actiondata){
if($actiondata->type=='email'){
$actiondata->enabled=0;//<----this doesn't change the entry.
$actiondata->params='';//<----nor does this.
}
}
}
For some reason I cannot change the main_event_action if it's the type 'email'.
However, other main_event_action types can be changed.
if($actiondata->type=='custom_serverside_validation'){//<--- if this isn't the 'email' type
$actiondata->enabled=0;//<----this works
$actiondata->params='';//<----as does this.
}
Can anyone suggest a solution?
If a user submits information that requires information to be emailed to him, then an email is sent.
If he doesn't then no email is sent.
I can't see how to disable the email.
There's a PHP array called "main_event_actions" which contains the following stdClass objects:
Array (
[0] => stdClass Object (
[id] => 1612
[chronoform_id] => 12
[type] => custom_serverside_validation
[enabled] => 1
[params] =>
[order] => 16
[content1] => {PHP code}
)
[1] => stdClass Object (
[id] => 1617
[chronoform_id] => 12
[type] => auto_serverside_validation
[enabled] => 1
[params] => {PHP Code}
[order] => 2
[content1] =>
)
[2] => stdClass Object (
[id] => 1613
[chronoform_id] => 12
[type] => custom_code
[enabled] => 1
[params] => mode=controller action_label=Classify Breed
[order] => 25
[content1] => {PHP Code} //<---- my custom code to verify the information submitted and to send the email (or not)
)
[3] => stdClass Object (
[id] => 1614
[chronoform_id] => 12
[type] => email
[enabled] => 1
[params] => {subject=Email from_email=noreply@royalcaninbreedersclub.com, etc, etc}
[order] => 20
[content1] => main_event_actions);
)
)
I've tried using this:
if(!$matches){
$breed='generic';
foreach($form->main_event_actions as $action => $actiondata){
if($actiondata->type=='email'){
$actiondata->enabled=0;//<----this doesn't change the entry.
$actiondata->params='';//<----nor does this.
}
}
}
For some reason I cannot change the main_event_action if it's the type 'email'.
However, other main_event_action types can be changed.
if($actiondata->type=='custom_serverside_validation'){//<--- if this isn't the 'email' type
$actiondata->enabled=0;//<----this works
$actiondata->params='';//<----as does this.
}
Can anyone suggest a solution?