# Sending password change email instead of verification email for a new user - Latest

**URL:** <https://community.auth0.com/t/sending-password-change-email-instead-of-verification-email-for-a-new-user-latest/137141>\
**Category:** Get Help\
**Tags:** user-password-management, user-management\
**Created:** [June 24, 2024, 2:10pm UTC](https://community.auth0.com/t/sending-password-change-email-instead-of-verification-email-for-a-new-user-latest/137141 "2024-06-24T14:10:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jaisantosh](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jaisantosh/32/50641_2.png) [@Jaisantosh](https://community.auth0.com/u/Jaisantosh)\
**Post date:** [June 24, 2024, 2:10pm UTC](https://community.auth0.com/t/sending-password-change-email-instead-of-verification-email-for-a-new-user-latest/137141/1 "2024-06-24T14:10:34Z")

</div>

I saw a post that was dated 2021 where it was suggested to create a hook but i dont see it in the latest version. how do i send password change email automatically when i manually signup a user?

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [June 24, 2024, 11:28pm UTC](https://community.auth0.com/t/sending-password-change-email-instead-of-verification-email-for-a-new-user-latest/137141/3 "2024-06-24T23:28:10Z")

</div>

Hey there @Jaisantosh !

> [@Jaisantosh](#):
>
> how do i send password change email automatically when i manually signup a user?

You can achieve this using a [Post Registration Action](https://auth0.com/docs/customize/actions/flows-and-triggers/post-user-registration-flow) and the [/dbconnections/change\_password](https://auth0.com/docs/api/authentication#change-password) endpoint of the Authentication API. An example Action might look like:

```auto
exports.onExecutePostUserRegistration = async (event, api) => {

const axios = require('axios');

  const domain = '{your_domain}';

  // Function to send password change email
  const sendPasswordChangeEmail = async (email) => {
    try {
      await axios.post(`https://${domain}/dbconnections/change_password`, {
        email: email,
        connection: 'Username-Password-Authentication' //or whichever database connection you are using
      }, {
        headers: {
          'Content-Type': 'application/json'
        }
      });
      console.log('Password change email sent successfully.');
    } catch (error) {
      console.error('Error sending password change email:', error);
      throw error;
    }
  };

  // Execute the function
  try {
    await sendPasswordChangeEmail(event.user.email);
  } catch (error) {
    console.error('Error in post user registration action:', error);
  }
}

```

This will immediately send the user an email to reset their password upon creation/registration.

---

<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:** [July 8, 2024, 11:28pm UTC](https://community.auth0.com/t/sending-password-change-email-instead-of-verification-email-for-a-new-user-latest/137141/4 "2024-07-08T23:28:52Z")

</div>

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