# Sending Email Invitations For Application Signup

**URL:** <https://community.auth0.com/t/sending-email-invitations-for-application-signup/57326>\
**Category:** Get Help\
**Tags:** reset-password, signup, email-verification, password-reset, verification-email\
**Created:** [February 4, 2021, 5:29am UTC](https://community.auth0.com/t/sending-email-invitations-for-application-signup/57326 "2021-02-04T05:29:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![brady](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/brady/32/25817_2.png) [@brady](https://community.auth0.com/u/brady)\
**Post date:** [February 4, 2021, 5:29am UTC](https://community.auth0.com/t/sending-email-invitations-for-application-signup/57326/1 "2021-02-04T05:29:40Z")

</div>

Hi Auth0 Community!

I’m trying to implement [Send Email Invitations for Application Signup](https://auth0.com/docs/auth0-email-services/send-email-invitations-for-application-signup), but am confused on a few things.

For context; I am allowing Admin users to create new users using the Management API, using the new user’s email and setting a random password, with the `email_verified` flag set to `false`.

I’ve read the docs linked about 42.5 times, and still cannot seem to understand where to go from there. When the user is created, right now, an email is automatically sent for them to _verify their email_. I think it makes sense, however, what I really need is for them to _set their password_ (and thus verify their email).

I know that I can create a password reset ticket with the management api, but obviously this can’t be done until the user is created in the database, which, upon creation, is automatically sending email-verification emails. I’d rather not have to send two emails as it would get confusing for users.

Reading the docs led me to believe that I would be able to configure this verification email to be a password reset email instead i.e. from the first three ‘steps’ listed on the page:

> 1. User receives an email inviting them to register.
> 2. User follows a link to the Set Up Password page.
> 3. User creates and verifies a password.

I’m not seeing anything else on that page that mentions emails besides customizing the template to outline the process going forward.

So I guess I’m just not able to read between the lines here. Is there a hook or rule I should be setting up? Am I missing something in my email templates? Should my automatic Email-Verification template be turned off? (I didn’t turn this on in the first place, which is part of the reason why I figured this template could be re-configured to have the user set their password)

Any help is greatly appreciated.

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [February 4, 2021, 6:18pm UTC](https://community.auth0.com/t/sending-email-invitations-for-application-signup/57326/3 "2021-02-04T18:18:52Z")

</div>

Hello @brady!

You can accomplish this with a Post User Registration Hook and customizing the Password Change email template.

1. In the email template section of your dashboard, disable the “Welcome Email” template and the “Email Verification” template by turning off the “Status” toggle. Make sure that “Change Password” is enabled.
2. Go to _Hooks_ and scroll down to “Post User Registration” and click “Create new hook”
3. Use the following code to send a password reset email whenever a user is manually created for your tenant:

```auto
module.exports = function (user, context, cb) {
  var auth0 = require('auth0@2.32.0');
  var authClient = new auth0.AuthenticationClient({
    domain: 'example-connections.us.auth0.com',
    clientId: 'YOUR_APP_CLIENT_ID',
    clientSecret: 'YOUR_APP_CLIENT_SECRET',
  });

  var userAndConnection = {
    email: user.email,
    connection: 'Username-Password-Authentication',
    connection_id: context.connection.id,
  };

  authClient.requestChangePasswordEmail(userAndConnection, function(err){
    cb(null, user, context);
  });
};

```

Now when a user is created using the Management API an email will be sent inviting them to change their password.

You will then need to update the email template to make it look more like a welcome email than a change password email. Here are docs on customizing email templates: [Customize Email Templates](https://auth0.com/docs/auth0-email-services/customize-email-templates)

Related topic: [Authenticate and prompt user password change with a single email](https://community.auth0.com/t/authenticate-and-prompt-user-password-change-with-a-single-email/57221)

---

<div class="post-metadata">

**Author:** ![brady](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/brady/32/25817_2.png) [@brady](https://community.auth0.com/u/brady)\
**Post date:** [February 5, 2021, 2:19am UTC](https://community.auth0.com/t/sending-email-invitations-for-application-signup/57326/4 "2021-02-05T02:19:57Z")

</div>

Thank you so much @stephanie.chamblee ! this is exactly what I needed.

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [February 5, 2021, 12:22pm UTC](https://community.auth0.com/t/sending-email-invitations-for-application-signup/57326/5 "2021-02-05T12:22:04Z")

</div>

Great to hear! Let us know if you have any other questions.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [February 20, 2021, 12:23pm UTC](https://community.auth0.com/t/sending-email-invitations-for-application-signup/57326/6 "2021-02-20T12:23:03Z")

</div>

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