Optional Approach to Email Invitations for Application Signup

Overview

This article describes a method for inviting users to an application. The process involves an administrator creating a new user, which triggers an email invitation for the user to set their password and gain access.

Applies To
  • Management API

  • Authentication API

Solution

The following steps describe how to send a password reset email after an administrator creates a user:

  1. Invite a user by creating a new user via the Management API Create a user endpoint. Set the email_verified parameter to false and assign a randomly generated password. This password will not be communicated or used.
  2. Trigger an interactive password reset flow by sending a request to the Authentication API Create A Password (Change Password) endpoint.
  3. Auth0 sends the Change Password email template.
  4. To customize the template, go to Branding > Email Templates.
  5. Select Change Password from the dropdown menu.
  6. Edit the subject and body. The following example shows how to change the subject line based on user verification status:
{% if user.email_verified %}Change password for{% else %}Welcome to{% endif %} {{ friendly_name }}
  1. When the user clicks the link in the email, the Password change page appears.
  2. NOTE: This page can also be customized to provide different text for a first-time invitation versus a standard password reset.
  3. Once the user sets their password, Auth0 automatically sets the email_verified property for the user to true, completing the invitation workflow.

Recommended content

No recommended content found...