Skip Navigation

[Resolved] confirmation mail

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

Problem:

I've used a cred_save_data hook script to set up a lastname+firstname+birthdate scheme for the login name, which also works fine.

The issue: it seems that the "new user registered" confirmation mail is being sent before the script can save the altered username.

Is there a method do trigger the confirmation mail after the cred_save_data hook?

Solution:

No, there isn't existed method do trigger the confirmation mail after the cred_save_data hook.

In your case, you can ask the new users to login with their email address, it should be able to work too.

Relevant Documentation:

This support ticket is created 3 years, 9 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
- 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 svenA-3 3 years, 9 months ago.

Assisted by: Luo Yang.

Author
Posts
#1653145

Tell us what you are trying to do?
I have set up a user role eligible via capabilities to register new users (= customers of my customer) with a specified role via Toolset User Form, which is working fine.
In order to spare that eligible "sub-admin" role to create fancy usernames and strong passwords, I have set these fields to auto-creation, which also works fine. However, I wanted a different scheme for the names.
So I've used a cred_save_data hook script to set up a lastname+firstname+birthdate scheme for the login name, which also works fine.

The issue: it seems that the "new user registered" confirmation mail is being sent before the script can save the altered username. No matter what placeholder I use for the confirmation mail, it turns out to be part of the email before "@" rather than the modified version delivered by the script.
My first thought was a possible delay on database entries, so I've added 2 seconds with sleep() to allow for the db write procedure unfortunately to no avail.
Is there a method do trigger the confirmation mail after the cred_save_data hook?

Is there any documentation that you are following?
Another support ticket included code for the cred_save_data hook that turned out to solve that part of the intended modification.

What is the link to your site?
hidden link

#1653869

Hello,

No, there isn't existed method do trigger the confirmation mail after the cred_save_data hook.

In your case, you can ask the new users to login with their email address, it should be able to work too.

And you can create your own custom place holder, and display it in email body, see our document:
https://toolset.com/documentation/user-guides/front-end-forms/how-to-use-custom-placeholders-in-cred-notifications/

#1654063

Thanks, hinting to the email option was a good idea. My issue is resolved now. Thank you!

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