Set email_verified true in a pre-registration action

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?

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:

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

Thanks,
Rueben

Hi @rueben.tiow,

thank you for the answer.

To create users I’m using WebAuth library (JSDoc: Class: WebAuth), there is not possible to set verify_email. There is something I’m missing or I have to use ayh0 apis directly?

Thank you

Hi @alin.ianitchii,

Thank you for your reply.

You will need to use the Management API’s Create a user 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

1 Like

Nice, I will do it that way.

Thank you for your suggestions.

1 Like

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