> ## Documentation Index
> Fetch the complete documentation index at: https://docs-staging-quickstart-revamp.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Describes how to use Liquid syntax in your email templates.

# Use Liquid Syntax in Email Templates

When using the [Email Templates](https://manage.auth0.com/#/branding/email_templates) available on the <Tooltip tip="Auth0 Dashboard: Auth0's main product to configure your services." cta="View Glossary" href="/docs/glossary?term=Auth0+dashboard">Auth0 dashboard</Tooltip>, you have the option of using the Liquid template language to select the appropriate data and formatting your emails. Liquid is an open-source templating language that extends the functionality of HTML that you can use to dynamically generate your emails to contain varying information. To learn more, read [Liquid for Designers](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers) on Github.

Using Liquid, you can structure the `Subject` of your emails to display the appropriate application name, rather than hardcoding a particular value:

`We are {{application.name}}!`

HTML with Liquid syntax is supported in every field (except `URL Lifetime`) on the Verification, Change Password Confirmation, and Blocked Account email templates. For more information on supported output attributes and their usage, see [Customize Email Templates](/docs/customize/email/email-templates).

There are two types of markup in Liquid: output and tag.

### Output markup

**Output** markup resolves to text and is surrounded by two pairs of matching curly braces:

`Hello {{ name }}!`

You can further customize the appearance of the output by using filters, which are simple methods. For example, the `upcase` filter will convert the text which is passed to the filter to uppercase:

`Hello {{ name | upcase }}!`

Multiple filters are separated by `|` and are processed from left to right, applying the subsequent filter to the result of the previous one. The template will render the final result.

The following filters are supported:

<table class="table">
  <thead>
    <tr>
      <th>Filter</th>
      <th>Description</th>
      <th>Example</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>append</code></td>
      <td>Append a string</td>
      <td>`{{ 'foo' | append:'bar' }} #=> 'foobar'`</td>
    </tr>

    <tr>
      <td><code>capitalize</code></td>
      <td>Capitalize words in the input sentence</td>
      <td>`{{ "my great title" | capitalize }} #=> My great title`</td>
    </tr>

    <tr>
      <td><code>date</code></td>
      <td>Reformat a date (<a href="http://docs.shopify.com/themes/liquid-documentation/filters/additional-filters#date">syntax reference</a>)</td>

      <td />
    </tr>

    <tr>
      <td><code>default</code></td>
      <td>Returns the given variable unless it is null or the empty string, when it will return the given value</td>
      <td>`{{ undefined_variable | default: "Default value" }} #=> "Default value"`</td>
    </tr>

    <tr>
      <td><code>divided\_by</code></td>
      <td>Integer division</td>
      <td>`{{ 10 | divided_by:3 }} #=> 3`</td>
    </tr>

    <tr>
      <td><code>downcase</code></td>
      <td>Convert an input string to lowercase,</td>
      <td>`{{ "Parker Moore" | downcase }} #=> parker moore`</td>
    </tr>

    <tr>
      <td><code>escape</code></td>
      <td>HTML escape a string</td>
      <td>`{{ "Have you read 'James &amp; the Giant Peach'?" | escape }} #=> Have you read &amp;#39;James &amp;amp; the Giant Peach&amp;#39;?`</td>
    </tr>

    <tr>
      <td><code>escape\_once</code></td>
      <td>Returns an escaped version of HTML without affecting existing escaped entities</td>
      <td>`{{ "1 &lt; 2 &amp;amp; 3" | escape_once }} #=> 1 &amp;lt; 2 &amp;amp; 3`></td>
    </tr>

    <tr>
      <td><code>first</code></td>
      <td>Get the first element of the passed in array</td>

      <td />
    </tr>

    <tr>
      <td><code>join</code></td>
      <td>Join elements of the array with certain character between them</td>

      <td />
    </tr>

    <tr>
      <td><code>last</code></td>
      <td>Get the last element of the passed in array</td>

      <td />
    </tr>

    <tr>
      <td><code>map</code></td>
      <td>Map/collect an array on a given property</td>

      <td />
    </tr>

    <tr>
      <td><code>minus</code></td>
      <td>Subtraction</td>
      <td>`{{ 4 | minus:2 }} #=> 2`</td>
    </tr>

    <tr>
      <td><code>modulo</code></td>
      <td>Remainder</td>
      <td>`{{ 3 | modulo:2 }} #=> 1`</td>
    </tr>

    <tr>
      <td><code>newline\_to\_br</code></td>
      <td>Replace each newline (\n) with HTML break</td>

      <td />
    </tr>

    <tr>
      <td><code>plus</code></td>
      <td>Addition</td>
      <td>`{{ '1' | plus:'1' }} #=> 2`, `{{ 1 | plus:1 }} #=> 2`</td>
    </tr>

    <tr>
      <td><code>prepend</code></td>
      <td>Prepend a string</td>
      <td>`{{ 'bar' | prepend:'foo' }} #=> 'foobar'`</td>
    </tr>

    <tr>
      <td><code>remove</code></td>
      <td>Remove each occurrence</td>
      <td>`{{ 'foobarfoobar' | remove:'foo' }} #=> 'barbar'`</td>
    </tr>

    <tr>
      <td><code>remove\_first</code></td>
      <td>Remove the first occurrence</td>
      <td>`{{ 'barbar' | remove_first:'bar' }} #=> 'bar'`</td>
    </tr>

    <tr>
      <td><code>replace</code></td>
      <td>Replace each occurrence</td>
      <td>`{{ 'foofoo' | replace:'foo','bar' }} #=> 'barbar'`</td>
    </tr>

    <tr>
      <td><code>replace\_first</code></td>
      <td>Replace the first occurrence</td>
      <td>`{{ 'barbar' | replace_first:'bar','foo' }} #=> 'foobar'`</td>
    </tr>

    <tr>
      <td><code>round</code></td>
      <td>Rounds input to the nearest integer or specified number of decimals</td>
      <td>`{{ 4.5612 | round: 2 }} #=> 4.56`</td>
    </tr>

    <tr>
      <td><code>size</code></td>
      <td>Return the size of an array or string</td>
      <td>`{{ "Ground control to Major Tom." | size }} #=> 28`</td>
    </tr>

    <tr>
      <td><code>sort</code></td>
      <td>Sort elements of the array</td>

      <td />
    </tr>

    <tr>
      <td><code>split</code></td>
      <td>Split a string on a matching pattern</td>
      <td>`{{ "a~b" | split:"~" }} #=> ['a','b']`</td>
    </tr>

    <tr>
      <td><code>strip\_html</code></td>
      <td>Strip HTML from string</td>
      <td>`{{ "How &lt;em&gt;are&lt;/em&gt; you?" | strip_html }} #=> How are you?`</td>
    </tr>

    <tr>
      <td><code>strip\_newlines</code></td>
      <td>Strip all newlines (\n) from string</td>

      <td />
    </tr>

    <tr>
      <td><code>times</code></td>
      <td>Multiplication</td>
      <td>`{{ 5 | times:4 }} #=> 20`</td>
    </tr>

    <tr>
      <td><code>truncate</code></td>
      <td>Truncate a string down to x characters. It also accepts a second parameter that will append to the string</td>
      <td>`{{ 'foobarfoobar' | truncate: 5, '.' }} #=> 'foob.'`</td>
    </tr>

    <tr>
      <td><code>truncatewords</code></td>
      <td>Truncate a string down to x words</td>

      <td />
    </tr>

    <tr>
      <td><code>upcase</code></td>
      <td>Convert an input string to uppercase</td>
      <td>`{{ "Parker Moore" | upcase }} #=> PARKER MOORE`</td>
    </tr>
  </tbody>
</table>

### Tag markup

**Tag** markup does not resolve to text and is surrounded by a pair of matched curly braces and percent signs:

`{% this does not resolve to text %}`

Tags are typically used to apply logic to your template. Using the Liquid [supported tags](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers#tags), you can have one template meet several needs.

You could use tags to execute `if / else` statements to have a single template send out emails in multiple languages.

For example:

```liquid wrap lines
{% if user.user_metadata.lang == 'en' %} [email body in English] {% elsif user.user_metadata.lang == 'de' %} [email body in German] {% endif %}
```

If you need to use additional conditions, consider using a case statement. To learn more about case statements, see [Liquid for Designers](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers#case-statement) on Github.

#### Tag comments

Any content between `{% comment %}` and `{% endcomment %}` tags will not be rendered.

`This will be seen. {% comment %} This will not be seen. {% endcomment %}`

#### Tag raw

To temporarily disable processing of Liquid markup, use `{% raw %}` and `{% endraw %}`. This is useful if you are using syntax that conflicts with Liquid.

For example, you can escape the following `Mustache.js` line as follows:

```liquid wrap lines
{% raw %} var clients = "Clients:<ul>{{#client}}<li>{{fn}} {{ln}}" + {{phone}}</li>{{/client}}</ul>"; {% endraw %}
```

## Debug variables

To assist your template development, we've added a custom `{% 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.

## Learn more

* [Customize Email Templates](/docs/customize/email/email-templates)
* [Email Template Descriptions](/docs/customize/email/email-templates/email-template-descriptions)
* [Customize Blocked Account Emails](/docs/customize/email/customize-blocked-account-emails)
