Skip Navigation

[Resolved] %%FORM_DATA%% does not show generic fields

This thread is resolved. Here is a description of the problem and solution.

Problem:

Setup custom mail notification placeholder for generic fields.

Solution:

You can create your own placeholders with filter hook "cred_body_notification_codes", for example:

https://toolset.com/forums/topic/form_data-does-not-show-generic-fields/#post-1392045

Relevant Documentation:

https://toolset.com/documentation/user-guides/how-to-use-custom-placeholders-in-cred-notifications/#using-custom-placeholders

This support ticket is created 5 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by Bob 5 years, 1 month ago.

Assisted by: Luo Yang.

Author
Posts
#1391577

Bob
cred fields.png
%%form_data%% output.png

In the notification mail that is sent, %%FORM_DATA%% does not show entries made in generic fields using CRED. Entries needed in this case are the 'single line' and 'phone' fields.

The form can be found here: hidden link

#1392045

Hello,

Yes, you are right, the placeholder %%FORM_DATA%% does not support generic field.

But you can create your own placeholders with filter hook "cred_body_notification_codes", for example:
1) Add below PHP codes in your theme file "functions.php":

add_filter('cred_body_notification_codes', 'gf_placeholder', 10, 3);
function gf_placeholder($defaultPlaceHolders, $form_id, $user_id) {
	$newPlaceHolders = array(
		'%%my-field-slug-1%%' => $_REQUEST['my-field-slug-1'],
		'%%my-field-slug-2%%' => $_REQUEST['my-field-slug-2'],
	);
    return array_merge($defaultPlaceHolders, $newPlaceHolders );
}

2) Use below placeholder in the form mail notification body:

%%my-field-slug-1%%
%%my-field-slug-2%%

Please replace my-field-slug-1 and my-field-slug-2 with your generic field's slugs.

More help:
https://toolset.com/documentation/user-guides/how-to-use-custom-placeholders-in-cred-notifications/#using-custom-placeholders
Using custom placeholders

#1392449

Bob

That did the trick! Thanks Luo 🙂