# Event based Conditionals and email templates

**URL:** <https://community.auth0.com/t/event-based-conditionals-and-email-templates/7223>\
**Category:** Get Help\
**Tags:** script, event, email, metadata, js\
**Created:** [June 23, 2017, 2:36am UTC](https://community.auth0.com/t/event-based-conditionals-and-email-templates/7223 "2017-06-23T02:36:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![josh1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/josh1/32/4154_2.png) [@josh1](https://community.auth0.com/u/josh1)\
**Post date:** [June 23, 2017, 2:36am UTC](https://community.auth0.com/t/event-based-conditionals-and-email-templates/7223/1 "2017-06-23T02:36:54Z")

</div>

Hello, my app has seperate password reset and changed password confirmation emails.

These are both directed through the auth0 password change template.  
I would like to be able to set a flag I can access within the template so I know whether it should be handled as a password reset or a password change.

Using user\_metadata and app\_metadata doesn’t seem appropriate. For example, with mailgun I have the ability to tag and send extra metadata on the email. This isn’t a direct comparison as I cannot script on mailgun itself but I can still pass that data through it using my app.

Do I have this kind of event-based flexibility with auth0 emails and how would I start?

---

<div class="post-metadata">

**Author:** ![prashantT](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/prashantt/32/6002_2.png) [@prashantT](https://community.auth0.com/u/prashantT)\
**Post date:** [June 23, 2017, 6:49am UTC](https://community.auth0.com/t/event-based-conditionals-and-email-templates/7223/2 "2017-06-23T06:49:14Z")

</div>

Auth0 does not support a password changed confirmation email out of the box. If you are using MailGun as your provider, and have the ability to trigger emails directly through MailGun, you have the option to use the [Authentication API Webhooks extension](https://auth0.com/docs/extensions/authentication-api-webhooks), configured for the Success Change Password log type. This could call an endpoint in your application (or on [Webtask.io](http://Webtask.io)), which would trigger the email via MailGun.

---

<div class="post-metadata">

**Author:** ![josh1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/josh1/32/4154_2.png) [@josh1](https://community.auth0.com/u/josh1)\
**Post date:** [June 23, 2017, 8:10am UTC](https://community.auth0.com/t/event-based-conditionals-and-email-templates/7223/3 "2017-06-23T08:10:43Z")

</div>

This doesn’t like what I need to accomplish.  
I would just send an email via mailgun directly after the password change happens through my api call.

Auth0 does support it through the ‘verify\_password’ option in [Auth0 Management API v2](https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id).

It uses the password reset template so the content of that email is all wrong for a password change event.

The user should verify they have changed their password before it has actually changed.

---

<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 2, 2018, 5:54am UTC](https://community.auth0.com/t/event-based-conditionals-and-email-templates/7223/4 "2018-03-02T05:54:54Z")

</div>


