Auth0 Home Blog Docs

Can I use {{ client.client_metadata }} inside custom email templates?

email-template

#1

I have set a client metadata in advanced settings for my application. I don’t seem to be able to use {{ client.client_metadata.foo }} in my custom email templates.

Is this a supported feature for custom email templates?


#2

You can use {{ client.client_metadata.foo }} in email templates. Make sure you are testing from the application itself i.e signing up a real user so you receive the verification email and then verifying the email to receive the welcome email. if you send a test email from the dashboard, it may not include all the variables in the emails.

For testing and debugging purposes, you can include {% debug %} tag inside the email template to receive all the available variables you can use inside the email.


#3

Thank you so much for your response. the template debug section that came through someone didn’t have {{ client.client_metadata }} in it at all. Also, it looks like the Client ID that came through in the debug template isn’t one of the applications I have. So - it is strange. Investigating more.

But one field I got interested in is { “home_url”: “about:blank”, } I want to use this in the email template to link to the domain URL (so it can be different for staging and production). Where do I set this variable?

Thank you again.


#4

This may be because you have sent the emails from your management dashboard and not directly from one of your Applications. The Client ID used when you Send/“Try” the emails from dashboard is a generic application called “All Applications” that will not show up in the Application list.

“home_url” and “support_url” are the same. They can be configured in your tenant settings under Support URL: https://manage.auth0.com/#/tenant

Hope this helps.


#5

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