# Use username in email template

**URL:** <https://community.auth0.com/t/use-username-in-email-template/64753>\
**Category:** Get Help\
**Tags:** email, email-template, username\
**Created:** [June 20, 2021, 9:06am UTC](https://community.auth0.com/t/use-username-in-email-template/64753 "2021-06-20T09:06:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![veerle](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/veerle/32/12902_2.png) [@veerle](https://community.auth0.com/u/veerle)\
**Post date:** [June 20, 2021, 9:06am UTC](https://community.auth0.com/t/use-username-in-email-template/64753/1 "2021-06-20T09:06:22Z")

</div>

I’m trying to send a custom email which contains the username in the HTML body. I’m using this:

```auto
 <p><strong>Your username: </strong>{{ user.username }}</p>

```

However, this comes up empty in the email, while my raw JSON for the specific users does have a field for username:

 ![Screenshot 2021-06-20 at 11.03.45 AM](https://global.discourse-cdn.com/auth0/original/3X/0/5/050a6b896094c8eb34ceb1a33b081a1248bb2fa9.png)

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [June 21, 2021, 8:33am UTC](https://community.auth0.com/t/use-username-in-email-template/64753/2 "2021-06-21T08:33:11Z")

</div>

I guess that’s because of the fact that this property cannot be accessed at least that’s what this doc says:

> **[Customize Email Templates](https://auth0.com/docs/customize/email/email-templates)**
>
> Learn how to customize your emails with Liquid templating syntax.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [June 21, 2021, 8:38am UTC](https://community.auth0.com/t/use-username-in-email-template/64753/3 "2021-06-21T08:38:53Z")

</div>

The username property isn’t mentioned in the available properties list

---

<div class="post-metadata">

**Author:** ![gerry.mclarnon](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gerry.mclarnon/32/60968_2.png) [@gerry.mclarnon](https://community.auth0.com/u/gerry.mclarnon)\
**Post date:** [July 30, 2024, 2:17pm UTC](https://community.auth0.com/t/use-username-in-email-template/64753/4 "2024-07-30T14:17:07Z")

</div>

If the username property isn’t available in Email Templates how should the user be informed of their username?

---

<div class="post-metadata">

**Author:** ![ines.marques](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ines.marques/32/70442_2.png) [@ines.marques](https://community.auth0.com/u/ines.marques)\
**Post date:** [January 13, 2025, 4:01pm UTC](https://community.auth0.com/t/use-username-in-email-template/64753/5 "2025-01-13T16:01:44Z")

</div>

Hi, have you been able to find a solution for this? @gerry.mclarnon

---

<div class="post-metadata">

**Author:** ![gerald.czifra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gerald.czifra/32/75301_2.png) [@gerald.czifra](https://community.auth0.com/u/gerald.czifra)\
**Post date:** [January 13, 2025, 6:22pm UTC](https://community.auth0.com/t/use-username-in-email-template/64753/7 "2025-01-13T18:22:19Z")

</div>

Hi @ines.marques

Welcome to the Community!  
Although **username** is not currently within the the [Email Template Common Variables](https://auth0.com/docs/customize/email/email-templates#common-variables), it can still be invoked by mapping username to user.user\_metadata. This has been outlined in our following [Knowledge Article](https://community.auth0.com/t/add-username-to-email-template-variables/151081).

Hope this helps!  
Gerald

---

<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:** [January 27, 2025, 6:22pm UTC](https://community.auth0.com/t/use-username-in-email-template/64753/8 "2025-01-27T18:22:40Z")

</div>

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