# Set email\_verified true in a pre-registration action

**URL:** <https://community.auth0.com/t/set-email-verified-true-in-a-pre-registration-action/104183>\
**Category:** Get Help\
**Tags:** emails, management-api\
**Created:** [April 5, 2023, 3:54pm UTC](https://community.auth0.com/t/set-email-verified-true-in-a-pre-registration-action/104183 "2023-04-05T15:54:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![alin.ianitchii](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/alin.ianitchii/32/46091_2.png) [@alin.ianitchii](https://community.auth0.com/u/alin.ianitchii)\
**Post date:** [April 5, 2023, 3:54pm UTC](https://community.auth0.com/t/set-email-verified-true-in-a-pre-registration-action/104183/1 "2023-04-05T15:54:57Z")

</div>

Hi,

I explored how auth0 actions work. At the moment the only parameters which can be accessed on user object are user and app metadata.

I would like to put a logic in pre-registration of the user. If the user metadata contains the field “invited: true”, I want to set email\_verified true to avoid sending mails to users with this metadata.

In my application when a user registers following a custom link I’m sure that the email is verified therefore I want to avoid sending verification emails for these users.

How can I achieve this behavior?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [April 6, 2023, 1:43am UTC](https://community.auth0.com/t/set-email-verified-true-in-a-pre-registration-action/104183/3 "2023-04-06T01:43:48Z")

</div>

Hi @alin.ianitchii,

Welcome to the Auth0 Community!

I understand that you would like to prevent the verification email sent to newly created users.

The best way to accomplish this is to create the users with the `verify_email` property set to **false**.

Doing so will prevent sending the email verification to the user on creation. See below for more details:

> **[Auth0 Management API v2](https://auth0.com/docs/api/management/v2#!/Users/post_users)**

Please let me know if there’s anything else I can do to help.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![alin.ianitchii](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/alin.ianitchii/32/46091_2.png) [@alin.ianitchii](https://community.auth0.com/u/alin.ianitchii)\
**Post date:** [April 6, 2023, 7:55am UTC](https://community.auth0.com/t/set-email-verified-true-in-a-pre-registration-action/104183/4 "2023-04-06T07:55:42Z")

</div>

Hi @rueben.tiow,

thank you for the answer.

To create users I’m using WebAuth library ([JSDoc: Class: WebAuth](https://auth0.github.io/auth0.js/WebAuth.html)), there is not possible to set `verify_email`. There is something I’m missing or I have to use ayh0 apis directly?

Thank you

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [April 6, 2023, 3:50pm UTC](https://community.auth0.com/t/set-email-verified-true-in-a-pre-registration-action/104183/5 "2023-04-06T15:50:09Z")

</div>

Hi @alin.ianitchii,

Thank you for your reply.

You will need to use the [Management API’s Create a user](https://auth0.com/docs/api/management/v2#!/Users/post_users) endpoint to create the user with the `verify_email: false` property.

In summary, I recommend creating the users whose user\_metadata `"invited: true"` to also have `"verify_email: false"`. This way, it prevents sending the verification email to the newly created users.

I hope the explanation was clear!

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![alin.ianitchii](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/alin.ianitchii/32/46091_2.png) [@alin.ianitchii](https://community.auth0.com/u/alin.ianitchii)\
**Post date:** [April 9, 2023, 5:09pm UTC](https://community.auth0.com/t/set-email-verified-true-in-a-pre-registration-action/104183/6 "2023-04-09T17:09:59Z")

</div>

Nice, I will do it that way.

Thank you for your suggestions.

---

<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:** [April 23, 2023, 5:10pm UTC](https://community.auth0.com/t/set-email-verified-true-in-a-pre-registration-action/104183/7 "2023-04-23T17:10:46Z")

</div>

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