Skip Navigation

[Resolved] User creation notification email fields blank

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

Problem: Several user meta fields are no longer displaying the correct information in my CRED form.

Solution: Ensure that your fields are placed in the mail notification using the proper syntax, using user_id="%%USER_USERID%%" when necessary for custom user fields, and using placeholders only for other user fields.

Relevant Documentation: https://toolset.com/documentation/user-guides/cred-user-forms-email-notifications/

This support ticket is created 7 years 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 5 replies, has 2 voices.

Last updated by nickH-5 7 years ago.

Assisted by: Christian Cox.

Author
Posts
#506097
settings.png
email.png

The emails sent when a new user is created have no user data in them. This appears to have crept in in the last few weeks; this form was working fine before.

Basically, the email is sent correctly but all of the field information is missing.

The user is created fine along with all their usermeta and they receive the WordPress password rest email fine.

This problem is NOT limited to one form and appears to be happening for all user forms

Possibly related - my post forms often seem to create the post AND another blank post with the title "CRED Autodraft......."

See screenshot of notification email and of the email settings.

#506509

Hi, try adding the following parameter to your custom types fields:

user_id="%%USER_USERID%%"

For example:

[types usermeta="first_name" user_id="%%USER_USERID%%" user_is_author="true"][/types]

Please let me know the results. Also if this does not resolve the problem for you, please answer the following questions for me:
1. Where is this CRED form placed, and how have you placed it there?
2. If you temporarily disable all non-Toolset plugins and activate a default theme like Twenty Seventeen, does the problem persist?
3. Are any errors logged in your PHP error logs? You can see how to enable debug logging here:
https://toolset.com/documentation/user-guides/debugging-toolset/

Go in your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:

define('WP_DEBUG', true);

Then add these lines, just before it says 'stop editing here':

ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');

Attempt to create a new User using the CRED form. If any errors are generated, this will create an error_log.txt file in your site's root directory. Please send me its contents. Once that is done, you can revert the updates you made to wp-config.php.

CRED Auto Drafts are used on the back end to prevent duplicate posts, and should be cleared out every 8 hours or so by a CRON running in the background. Please let me know if this is not the case for you, but if they're less than 8 hours old they are not a problem.

#506660

Thank you. Doing this seems to have solved the issue.

Incidentally, when adding a new field the code user_id="%%USER_USERID%%" appears to be automatically added. Is there a reason why this wasn't there in the original form? is this a migration between versions issue?

Thanks

#506762

I have now discovered however that this solution appears not to work for the user email field which appears blank on the email. Here is what I am using:

<p>Email 2 : [wpv-user field="user_email" user_id="%%USER_USERID%%"]</p>

What I am trying to get is the email address allocated to the new user. In the form, this is :

	
<div class="cred-field cred-field-user_email">
		<label class="cred-label">
Email
</label>
		[cred_field field='user_email' post='user' value='' urlparam='']
	</div>
#506856
Screen Shot 2017-03-28 at 9.32.36 AM.png

Hi the syntax for a standard user field (any of those shown in the Body Codes section of the email body - see the screenshot) is a bit different than the syntax for a custom user field. You can simply use the field placeholder:

%%USER_EMAIL%%

If you use the Body Codes section of the email notification form, this syntax will be generated for you automatically for any of these fields. The email notification syntax has become more strictly enforced over the versions, so you may find the User forms documentation helpful for a quick refresher:
https://toolset.com/documentation/user-guides/cred-user-forms-email-notifications/

#506895

Perfect thanks

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.