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

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?

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.

1 Like

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.

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.

1 Like

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