Use username in email template

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

 <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:

What am I doing wrong?

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

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

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

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

Hi @ines.marques

Welcome to the Community!
Although username is not currently within the the Email Template Common Variables, it can still be invoked by mapping username to user.user_metadata. This has been outlined in our following Knowledge Article.

Hope this helps!
Gerald