I’m able to use Auth0’s Management API to create a user and a password reset ticket per the instructions, but it’s not clear how to proceed with the email template per the “Create email template” section. There doesn’t seem to be a way to send an email using the API. Any help would be appreciated.
I ended up using another email provider. It would be nice if Auth0 worked as it is documented/advertised but after much digging this feature doesn’t seem to be supported.
For the process outlined in the documentation, you have two options currently:
A.) Generate a password reset ticket URL, and append it to an email that you send yourself, be it via your email provider’s API or manually.
B.) Customise your Auth0 tenant’s password reset email template, so that the wording in the template makes sense to the end-user, such that it could be used for both an invite flow and a password reset flow, and then trigger the reset password flow via the change_password endpoint to send them the email via Auth0
As a side note, the Organizations feature has recently introduced an invite flow, but this currently cannot be used for anything other than inviting members to Organizations:
Hey - I’m unsure how we customize the password reset email given a hook that I have set up to change a password. I’m using this code to generate a hook - Authenticate and prompt user password change with a single email - #4 by Lee_Peters. But given the fact that email template is HTML and there isn’t a parameter that we can send in the authClient.requestChangePasswordEmail function call specifying that it is a set up, I’m confused on how to proceed/customize the template. Thanks
I’m afraid you can’t send a parameter or similar to that endpoint to change the contents of the Password Reset email, instead if you are using Auth0’s email sending features only you would need to customise the template to play a dual role so the wording made sense to the end user from both an invite and a forgotten password flow, so you could send them the same email for both flows interchangeably.
If you want to have a completely separate email template, you would need to use your hook to send the email directly via your SMTP provider’s endpoints, or send it manually/automate the process externally when you created a new user.
This makes a ton of sense - thanks! For now, I’ve adjusted the wording actually in a welcome email to say that you will get a change password email which acts as setting a password for your account the first time you receive that email. I’ll think about going the SMTP provider solution possibly later but for now what you described works