Tell us what you are trying to do?
I have added a custom field 'structure' to the user registration form. I want the notification sent after validation of the current form to contain the text from this custom field.
Is there any documentation that you are following?
https://toolset.com/forums/topic/how-to-add-custom-fields-in-a-notification-email-linked-to-user-form/
Is there a similar example that we can see?
Here is the custom field in the form in html :
<div class="form-group col-md-6">
<label for="%%FORM_ID%%_structure">[cred_i18n name='structure-label']Nom de la structure[/cred_i18n]</label>
[cred_field field='structure' force_type='field' class='form-control' output='bootstrap']
</div>
Here is the code I put in functions.php :
add_filter('cred_body_notification_codes', 'func_merge_custom_notification_placeholder', 10, 1);
function func_merge_custom_notification_placeholder($defaultPlaceHolders) {
return array_merge($defaultPlaceHolders, array('%%STRUCTURE%%' => $_REQUEST['structure']));
}
And the short code I tried without success:
%%STRUCTURE%% and [types field='field' item='%%STRUCTURE%%'][/types]
Nigel
Supporter
Les langues:
Anglais (English )
Espagnol (Español )
Fuseau horaire:
Europe/London (GMT+00:00)
Hi there
You shouldn't need any custom code to output a custom field that is included in the form.
But for a user form, you will need to add the argument user_id="%%USER_USERID%%"
See https://toolset.com/course-lesson/send-notifications-when-someone-submits-the-form/#displaying-post-and-user-fields-in-notifications
My issue is resolved now. Thank you!