# User.user\_metadata not populating in "Change Password" email template

**URL:** <https://community.auth0.com/t/user-user-metadata-not-populating-in-change-password-email-template/93134>\
**Category:** Get Help\
**Tags:** user\_metadata, email-template\
**Created:** [October 26, 2022, 11:42am UTC](https://community.auth0.com/t/user-user-metadata-not-populating-in-change-password-email-template/93134 "2022-10-26T11:42:21Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![nick.howard.lykke](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nick.howard.lykke/32/40836_2.png) [@nick.howard.lykke](https://community.auth0.com/u/nick.howard.lykke)\
**Post date:** [October 26, 2022, 11:42am UTC](https://community.auth0.com/t/user-user-metadata-not-populating-in-change-password-email-template/93134/1 "2022-10-26T11:42:22Z")

</div>

Hello, I’ve been having some trouble with an email template. It doesn’t seem to be an issue on _all_ of the templates, however.

I’ve got a template set up for “Change Password” emails, that attempts to lift a property from the `user.user_metadata` object. However, the values do not populate. I have appended a `{%debug%}` statement to the bottom of the e-mail template, and it confirms this.

I have verified that the user has the correct metadata property set (which is does), and I also have the exact same logic working on a “Verification Email (using Link)” template.

Is there any reason I cannot access the metadata from the “Change Password” template?

---

<div class="post-metadata">

**Author:** ![nick.howard.lykke](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nick.howard.lykke/32/40836_2.png) [@nick.howard.lykke](https://community.auth0.com/u/nick.howard.lykke)\
**Post date:** [October 26, 2022, 12:42pm UTC](https://community.auth0.com/t/user-user-metadata-not-populating-in-change-password-email-template/93134/2 "2022-10-26T12:42:09Z")

</div>

It also appears that using the `Try` button sends the metadata, but when an actual one is sent from my auth0 URL, then the metadata is not included.

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [October 27, 2022, 5:36am UTC](https://community.auth0.com/t/user-user-metadata-not-populating-in-change-password-email-template/93134/4 "2022-10-27T05:36:05Z")

</div>

Hi @nick.howard.lykke ,

I understand that you want to call a user.user\_metadata property in the `Change Password` email template. I tested this by adding the property parameter as below

`<p>You have submitted a password change request.{{user.user_metadata.userproperty}}</p>`

, where `userproperty` is a property name under user\_metadata. In my testing, the value saved under `userproperty` was populated correctly with both `Try button` and clicking on the `forgot password link` on the login page.

Could you try the above scripts and let me know how it goes? If the issue persists, please provide the scripts in your `Change Password` template. I am happy to look into this further.

Thanks!

---

<div class="post-metadata">

**Author:** ![nick.howard.lykke](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nick.howard.lykke/32/40836_2.png) [@nick.howard.lykke](https://community.auth0.com/u/nick.howard.lykke)\
**Post date:** [October 27, 2022, 7:04am UTC](https://community.auth0.com/t/user-user-metadata-not-populating-in-change-password-email-template/93134/5 "2022-10-27T07:04:13Z")

</div>

Hi @lihua.zhang

Yes, you are correct.

I have updated the `user_metadata` on my user to have the following properties:

```auto
{
  "requestLanguage": "en,en-US;q=0.9",
  "userProperty": "test"
}

```

The `requestLanguage` is the property I have been trying to read previously, and `userProperty` is a new one, I have just added now.

Then in my template, I added the following at the end (before the `</body>` tag:

```auto
<pre>test value: {{user.user_metadata.userProperty}}</pre>
<pre>{%debug%}</pre>

```

The results are still the same:

When using the `Try` button, I get:

> test value: test

When submitting the actual email, I get:

> test value:

Also, when using `Try`, the debug of the user object includes `user_metadata` properties, but the actual email does not.

---

<div class="post-metadata">

**Author:** ![nick.howard.lykke](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nick.howard.lykke/32/40836_2.png) [@nick.howard.lykke](https://community.auth0.com/u/nick.howard.lykke)\
**Post date:** [October 27, 2022, 8:39am UTC](https://community.auth0.com/t/user-user-metadata-not-populating-in-change-password-email-template/93134/7 "2022-10-27T08:39:20Z")

</div>

There looks to be a mismatch between the `clientId`s being used.

The user signs up with one, and has their password reset email sent using the same one… but, the Try button uses a different `clientId`.

So

- user signs up - `client-a` with `user_metadata`
- user resets password - `client-a` but no `user_metadata`
- I use the `Try` button - `client-b` even though the `connection` dropdown uses the same name as `client-a`… this has `user_metadata`.

I’m really confused about this.

---

<div class="post-metadata">

**Author:** ![nick.howard.lykke](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nick.howard.lykke/32/40836_2.png) [@nick.howard.lykke](https://community.auth0.com/u/nick.howard.lykke)\
**Post date:** [October 27, 2022, 9:06am UTC](https://community.auth0.com/t/user-user-metadata-not-populating-in-change-password-email-template/93134/8 "2022-10-27T09:06:11Z")

</div>

I’ve looked in the admin console at the user that has been created and their Authorized Applications only includes `client-a`.

Also, I can’t find any applications that have a clientId for `client-b`.

---

<div class="post-metadata">

**Author:** ![nick.howard.lykke](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nick.howard.lykke/32/40836_2.png) [@nick.howard.lykke](https://community.auth0.com/u/nick.howard.lykke)\
**Post date:** [October 27, 2022, 9:25am UTC](https://community.auth0.com/t/user-user-metadata-not-populating-in-change-password-email-template/93134/9 "2022-10-27T09:25:05Z")

</div>

I’ve managed to locate `client-b`. It relates to the `All Applications` application. However, it doesn’t really help in this case, as it’s not something that will point to fixing my initial problem.

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [October 27, 2022, 5:13pm UTC](https://community.auth0.com/t/user-user-metadata-not-populating-in-change-password-email-template/93134/11 "2022-10-27T17:13:12Z")

</div>

Could you please DM me the name of your tenant, the email of the user that you clicked on “Forgot password” to trigger the email, and the name of the application that the user tried to log in to? Thanks!

---

<div class="post-metadata">

**Author:** ![nick.howard.lykke](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nick.howard.lykke/32/40836_2.png) [@nick.howard.lykke](https://community.auth0.com/u/nick.howard.lykke)\
**Post date:** [October 31, 2022, 8:08am UTC](https://community.auth0.com/t/user-user-metadata-not-populating-in-change-password-email-template/93134/12 "2022-10-31T08:08:33Z")

</div>

Sure thing, I’ll get it sent over to you now

---

<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:** [November 14, 2022, 8:08am UTC](https://community.auth0.com/t/user-user-metadata-not-populating-in-change-password-email-template/93134/13 "2022-11-14T08:08:51Z")

</div>

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