# Trigger action on user email verification

**URL:** <https://community.auth0.com/t/trigger-action-on-user-email-verification/78741>\
**Category:** Get Help\
**Created:** [February 22, 2022, 11:13pm UTC](https://community.auth0.com/t/trigger-action-on-user-email-verification/78741 "2022-02-22T23:13:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpb](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jpb/32/33947_2.png) [@jpb](https://community.auth0.com/u/jpb)\
**Post date:** [February 22, 2022, 11:13pm UTC](https://community.auth0.com/t/trigger-action-on-user-email-verification/78741/1 "2022-02-22T23:13:41Z")

</div>

hello, I would like to trigger an action when a user verifies their email.

I was reading other similar topics where it is recommended to set up a log-in action. But this wouldn’t be adequate since I need the action triggered only once when the user verifies.

How would I go about this if it is possible?

---

<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:** [February 23, 2022, 10:35pm UTC](https://community.auth0.com/t/trigger-action-on-user-email-verification/78741/3 "2022-02-23T22:35:09Z")

</div>

Hi @jpb,

Welcome to the Auth0 Community!

I understand that you would like to trigger an Action after email verification.

> [@jpb](#):
>
> How would I go about this if it is possible?

Unfortunately, there isn’t a dedicated flow to implement an Action after a user verifies their email.

In this case, you could consider the [Post-Login Action](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow) as an alternative, as you have discovered. With this approach, there is the option to check if the user’s email is verified and perform your logic.

If we consider only executing the action only once after the user verifies, we can append a custom value to the user’s user\_metadata (i.e action\_complete: true) and include it in our check. This way, we can guarantee execution only once.

For example:

```auto
exports.onExecutePostLogin = async (event, api) => {
  if (event.user.email_verified === true && !event.user.user_metadata.action_complete){
    // YOUR_LOGIC HERE
    api.user.setUserMetadata("action_complete", true) 
  }
}

```

Please take a moment to review [Event Object](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow/event-object) and [API Object](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow/api-object) for the Post-Login Action.

Hoped this helps!

Please let me know if you need additional clarification or have further questions.

Thank you.

---

<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:** [March 10, 2022, 10:36pm UTC](https://community.auth0.com/t/trigger-action-on-user-email-verification/78741/4 "2022-03-10T22:36:07Z")

</div>

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