# Passing user name in email verification template

**URL:** <https://forum.keycloak.org/t/passing-user-name-in-email-verification-template/16354>\
**Category:** Getting advice\
**Created:** [July 7, 2022, 12:37pm UTC](https://forum.keycloak.org/t/passing-user-name-in-email-verification-template/16354 "2022-07-07T12:37:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajat](https://avatars.discourse-cdn.com/v4/letter/r/ebca7d/32.png) [@rajat](https://forum.keycloak.org/u/rajat)\
**Post date:** [July 7, 2022, 12:37pm UTC](https://forum.keycloak.org/t/passing-user-name-in-email-verification-template/16354/1 "2022-07-07T12:37:20Z")

</div>

Hi team, I want to send the verification email to user when he creates account. I want to customize the email template ,css and want to pass the user name in the template to whom email will be sent. How can i do so?

Ex.

Hi \<user\_name\>,

Click button below to verify your email account.

---

<div class="post-metadata">

**Author:** ![gsmith](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/gsmith/32/294_2.png) [@gsmith](https://forum.keycloak.org/u/gsmith)\
**Post date:** [July 8, 2022, 12:45am UTC](https://forum.keycloak.org/t/passing-user-name-in-email-verification-template/16354/2 "2022-07-08T00:45:10Z")

</div>

Hello,

Think you have to make a new theme, perhaps something like this may help.

- [keycloak-theme-sample/email.scss at master · holisticon/keycloak-theme-sample · GitHub](https://github.com/holisticon/keycloak-theme-sample/blob/master/src/templates/email/email.scss)

---

<div class="post-metadata">

**Author:** ![rajat](https://avatars.discourse-cdn.com/v4/letter/r/ebca7d/32.png) [@rajat](https://forum.keycloak.org/u/rajat)\
**Post date:** [July 8, 2022, 6:43am UTC](https://forum.keycloak.org/t/passing-user-name-in-email-verification-template/16354/3 "2022-07-08T06:43:17Z")

</div>

I have created the new theme, but not able to figer out how I get ther username so that I can send it in email to user

---

<div class="post-metadata">

**Author:** ![Tharunvarshanth](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/tharunvarshanth/32/5552_2.png) [@Tharunvarshanth](https://forum.keycloak.org/u/Tharunvarshanth)\
**Post date:** [August 4, 2022, 5:38pm UTC](https://forum.keycloak.org/t/passing-user-name-in-email-verification-template/16354/4 "2022-08-04T17:38:20Z")

</div>

if you use existing email template. keycloak themes email folder your can find ftl files in there you can find **${kcSanitize(msg(“passwordResetBodyHtml”,link, linkExpiration, realmName, linkExpirationFormatter(linkExpiration)))?no\_esc}** this kind of code . inside this code you can add users username like this ${kcSanitize(msg(“passwordResetBodyHtml”,link, linkExpiration, realmName, linkExpirationFormatter(linkExpiration), **user.username** ))?no\_esc}

---

<div class="post-metadata">

**Author:** ![rajat](https://avatars.discourse-cdn.com/v4/letter/r/ebca7d/32.png) [@rajat](https://forum.keycloak.org/u/rajat)\
**Post date:** [August 6, 2022, 9:10pm UTC](https://forum.keycloak.org/t/passing-user-name-in-email-verification-template/16354/5 "2022-08-06T21:10:10Z")

</div>

Thanks it worked. Btw it’s user.userName(). I checked the code it’s a function which we need to call .
