Auth0 Home Blog Docs

How does macros like {{application.name}}, {{url}} etc are made available to the email templates?

email-template
macros

#1

I’m trying to figure out how these macros are available in the email templates. Is there any way to create/customize one and use in the template?


#2

The macros available in the email templates are a controlled set, and cannot be customized. Depending on your use case, you could use metadata attributes, e.g.

{{ user.user_metadata.foo }}

#3

Thanks, @prashant for guiding in the right direction. I’ve also figured out that application and client are synonyms of each other and we can make use of client_metadata for application-level modifications in the email templates. E.g.

{{ client.client_metadata.foo }}

And this attribute ‘foo’ can be set in the client_metadata using the advanced settings section of the client panel. Please refer to the screenshot below.

![alt text][1]


#4

The macros available application and clients can not be modified but we can add some attributes in client object as per @prakharkumar79 suggested. and that can be accessed in email template as

{{ client.client_metadata.foo }}

This is the case can be used when we need to customize the URL in the email, rather than setting that field in {{user.user_metadata.foo}} this can be set in client.

But I think if we will use URL from client object will that be expired after the given URL lifetime?
@prashant your thoughts are valuable here.


#5