I need to use a custom form field value in the notification email. This field is called comercial.
<label for="%%FORM_ID%%_comercial">[cred_i18n name='comercial-label']Accepto enviament de correus comunicació[/cred_i18n]</label>
[cred_generic_field type='checkbox' field='comercial']
{
"required":0,
"default":"0"
}
[/cred_generic_field]
I found a solution in docs, and created this code in functions.php
add_filter('cred_subject_notification_codes', 'custom_generic_field_notification', 10, 1);
add_filter('cred_body_notification_codes', 'custom_generic_field_notification', 10, 1);
function custom_generic_field_notification( $defaultPlaceHolders ) {
$newPlaceHolders = array(
'%%COMERCIAL%%' => $_REQUEST['comercial']
);
return array_merge($defaultPlaceHolders, $newPlaceHolders );
}
And then in notification email %%COMERCIAL%%
I check the field in form, and I get a 0, not a 1.
Thank you,
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Hello. Thank you for contacting the Toolset support.
Can you please try to replace your generic field shortcode as given under and then test and try to resolve your issue.
[cred_generic_field type='checkbox' field='comercial']
{
"required":0,
"default":"1"
}
[/cred_generic_field]