Custom code doesn't work

send a copy of a form email based on a checkbox selection.

Overview

The issue occurred because custom code from an older CF version was incompatible with CFv5.
Use the Event Switcher action in CFv5 to conditionally send the email copy instead of custom code.

Answered
bo boeschung 30 Jun, 2014
Hello,

customers shall have the opportunity to click a checkbox to get a copy of the email. I used a custom code action with the following code (placed before email action):

<?php
if (!empty($form->data['checkbox12'])) {
$form->actions_config[0]["dto"] = "{field_email}";
$form->actions_config[0]["dsubject"] = "[Kopie] {field_subject}";
}
?>


I took the ID from email action. It doesn't work.

Have you any suggestions?

Best regards
Alfred
bo boeschung 02 Jul, 2014
No hint or any suggestions?

Best regards
Alfred
Gr GreyHead 02 Jul, 2014
Answer
Hi Alfred,

It looks as though you have found a bit of code from CFv3. In CFv5 there is an Event Switcher action which will handle this for you. Please see this FAQ

Bob
bo boeschung 02 Jul, 2014
Ah, okay. The Event Switcher is the solution :-)

Best regards
Alfred
This topic is locked and no more replies can be posted.