Skip Navigation

[Resolved] New user registration with a link to set password

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

Problem: I would like to use a Form to register Users, and when registration is complete I want to send the new User a direct link to reset their password.

Solution: Nothing like that is built into Forms, but you can use the cred_save_data API to programmatically trigger the wp_new_user_notification function, outside of the Forms notification system.

In the cred_save_data callback for a User Form, the $post_id variable will contain the new User's ID. If you'd like to customize the email, you can use the wp_new_user_notification_email filters.

Relevant Documentation:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
https://developer.wordpress.org/reference/functions/wp_new_user_notification/
https://developer.wordpress.org/reference/hooks/wp_new_user_notification_email/

This support ticket is created 5 years, 11 months 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 4 replies, has 2 voices.

Last updated by stephenR 5 years, 11 months ago.

Assisted by: Christian Cox.

Author
Posts
#1192664

Hi

I'm trying to create a user registration form that will behave in the same way as adding a new user in WordPress, so basically I want it to send an email to the new user's email address with a link for them to set their password once it's been submitted.

e.g.

Username: James

To set your password, visit the following address:

<hidden link;

There isn't a link to the site as it's just a development site on my local machine.

Thanks
Steve

#1192709
Screen Shot 2019-01-29 at 11.47.58 AM.png

Hi, there is a "reset password link" placeholder built into the Forms email notification system. You can set up an automatic email to be sent when the Form is submitted, and include a username and reset password link in the contents of the notification. See the attachment here. Will this work for your needs?

#1192717

Hi Christian

It's not ideal because instead of just clicking the link and setting the password, the user needs to click the link, enter their email address, check their email again, click the link and reset the password.

Is there no other way of doing it?

Many thanks
Steve

#1192720

Nothing built into Forms just like that, unfortunately, but you can use the cred_save_data API to programmatically trigger the wp_new_user_notification function, outside of the Forms notification system:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
https://developer.wordpress.org/reference/functions/wp_new_user_notification/

In the cred_save_data callback for a User Form, the $post_id variable will contain the new User's ID.

If you'd like to customize the email, you can use the wp_new_user_notification_email filters:
https://developer.wordpress.org/reference/hooks/wp_new_user_notification_email/

#1195411

My issue is resolved now. Thank you!