Auth0 - Inviting Users & Forgot Password collision

Hello!

Recently I implemented a functionality of inviting users where they are prompted to change their passwords after I create their profile. The flow:

  1. Create new user in Auth0
  2. Post-registration hook is triggered - an email is sent to this user with a link for changing his password.
  3. The email template is “Change Password” and it is customized in a way that represents “User Invitation”. (I am using SendGrid as email provider)

That works fantastic, BUT I realized that when I click “Forgot Password?” with a user that is already registered it is using the same template that I modified in order to simulate the invitation explained above.

I was wondering is there any way that I can create multiple templates for resetting password and respectively switch them depending on the case?

Are there any other solutions that might fit to my case? The thing is that I have to use this simulation of user invitation because when I create the user I have to setup various metadata properties.

Any suggestions would be appreciated,
Thank you!

Hello @lyubomir.nikov,

There is only one template for each type of template, but content can be customized or “programmed” using liquid syntax. In this way you can alter the content of the email based on various conditions including user profile attributes.

Mark

2 Likes

Hi, I would like to know how you achieve sending the Auth0 change password email in step (2).

The Actions documentation doesn’t give any example of calling the Auth0 Management functions to send an email for password reset, verification or enroll in MFA for example.

Do you have a link from this forum or could you please briefly explain. I suspect you may be importing the Auth0 management library directly since I could not find any ‘built-in management object’ within the Action editor.

Thanks!
Stu

I found out how to use the Management API within an action - it is on this forum but not in the Auth0 docs - it would be a very useful addition IMO.

https://community.auth0.com/t/how-can-i-use-the-management-api-in-actions/64947

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

Thanks for sharing it with the rest of community!