application
object, with access to the standard client properties like
application.name
application.clientID
application.metadata
connection.name
(except in the Multi-factor Enrollment Email)
request_language
user
object, with access to the following properties:
user.email
user.email_verified
user.picture
user.nickname
user.given_name
user.family_name
user.name
user.app_metadata
- stores information (such as a user’s support plan, security roles, or access control groups) that can impact a user’s core functionality, such as how an application functions or what the user can access.user.user_metadata
- stores user attributes (such as user preferences) that do not impact a user’s core functionality.tenant
- the raw tenant namefriendly_name
support_email
support_url
custom_domain.domain
- the tenant’s domain nameescape
function ({{ user.name | escape }}
):user.user_metadata
properties that may contain user-provided information must be escaped.organization.id
organization.display_name
organization.name
organization.metadata
organization.branding.logo_url
organization.branding.colors.primary
organization.branding.colors.page_background
{{ variable_name }}
syntax in Liquid. For example:
Hello {{ user.name }}. Welcome to {{ application.name }} from {{ friendly_name }}.
The attributes available for the user
object will depend on the type of connection being used. Individual email templates define additional variables that are appropriate for the specific template.
For those emails where the user needs to follow a link to take action, you can also configure the URL Lifetime and Redirect To URL destination after the action is completed. Liquid Syntax is also supported in the Redirect To URL field, but only three variables are supported:
application.name
application.clientID
application.callback_domain
1 From address
@auth0.com
. If you enter an @auth0.com
email address in From Addresses, Auth0 will continue to send default emails, but will ignore any configured customizations. If you are a Private Cloud user, you may configure a similar domain DenyList.application.name
friendly_name
(for the tenant’s defined friendly name){{ application.name }} <support@fabrikamcorp.com>
, as opposed to simply <support@fabrikamcorp.com>
.You must add the Sender Policy Framework (SPF) (to learn more, read Sender Policy Framework (SPF) on Wikipedia) and DomainKeys Identified Mail (to learn more, read DomainKeys Identified Mail (DKIM) on Wikipedia) DNS records to your domain’s zone file to allow Auth0 to send digitally-signed emails on your behalf. Without these records, the emails may end up in your users’ junk mail folders. Additionally, your users may see the following as the From Address:MyApp support@mail128-21.atl41.mandrillapp.com on behalf of MyApp support@fabrikamcorp.com
@
, or leave it empty, depending on the provider. The value of the record should look something like the following."v=spf1 include:spf.mandrillapp.com -all"
If you already have an SPF record you can simply add include:spf.mandrillapp.com
to the existing record.mandrill._domainkey
and the value to:2 Subject
application.name
user.email
(and other properties of the user
object)request_language
parameter to pull the language setting from the header value or default to the user’s browser language setting.For example:3 URL lifetime
http://myapplication.com/my_page/?email=john%contoso.com&message=Access%20expired.&success=false
4 Redirect To URL
success
indicator and a message
to the URL. To learn more about these two parameters, see Email Template Descriptions.With the New Universal Login Experience, Auth0 redirects users to the default log in route when the user succeeds in resetting the password. If not, Auth0 handles the errors as part of the Universal Login flow and ignores the redirect URL provided in the email template.Only the following three variables are available on the Redirect To URL:application.name
(or its synonym client.name
)application.clientID
application.callback_domain
(or its synonym client.callback_domain
)application.callback_domain
variable will contain the origin of the first URL listed in the application’s Allowed Callback URL list. This lets you redirect users to a path of the application that triggered the action by using a syntax like this:{{ application.callback_domain }}/result_page
Note that while the variable is called callback_domain
, it is really an origin, so it includes the protocol in addition to the domain, e.g. https://myapp.com
.If your application has multiple Allowed Callback URLs configured, Auth0 will use the first URL listed. You can also provide a default origin using Liquid syntax:{{ application.callback_domain | default: "https://my-default-domain.com" }}/result_page
{% if application.name == 'JWT.io' %} https://jwt.io {% else %} https://auth0.com {% endif %}
Because the application name is encoded for security, you should always use an encoded value (especially if your application name contains a character that changes once encoded). For example, you’ll want to use My%20App
instead of My App
.For single-page applications (SPAs), the Redirect To URL may contain the hash and route for a particular state/view in the app, followed by route parameters. This can cause the following issue with the Redirect To URL:http://localhost:3000/#/register
Which will result in a user getting redirected to the following URL:scheme|authority|path|query|fragment
. However, SPA frameworks (such as Angular) typically expect URLs in the scheme|authority|path|fragment|query
format (with the query string parameters at the end). This causes the application not to enter the expected state. For example, with the above URL, the app will be routed to /
instead of /#/register
.To work around this limitation of SPA frameworks, it is recommended to use a server-side callback URL as the redirect To URL with a route
parameter that preserves the SPA app route for the redirect. Once in this server-side URL, simply redirect to the SPA route saved in the route
parameter along with rest of the query string.route
parameter that records the SPA route for the redirect.
http://localhost:3001/register?route=register
route
and other parameters from the URL and redirects to the SPA route specified in route
parameter. Remember to append the other parameters received from Auth0.
5 Message body
user_metadata.lang
property from the user object to alter the content based on the user preferred language. For example, you can use an action to set the user_metadata.lang
property to it
for Italian. You must set the language property with an action or otherwise.{% debug %}
liquid tag, which outputs a summary of the template variables available to your template when it was rendered. Remember to remove this tag from any “live” templates.