> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dittofeed.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Liquid Presets

> Built-in Tags and Filters

Dittofeed comes with a number of built-in liquid tags, filters. These are available to use in your templates. These serve as useful utility functions for rendering messages.

## Tags

### `unsubscribe_link`

The `unsubscribe_link` tag outputs a link to unsubscribe from the message's [subscription group](/resources/subscription-groups).

```html theme={null}
{% unsubscribe_link %}
```

This renders a link of the form,

```html theme={null}
<a class="df-unsubscribe" clicktracking=off href="..." target="_blank">unsubscribe</a>
```

This tag is only usable in templates used within a [journey message node](resources/journey-nodes/message) that has been assigned a [subscription group](/resources/subscription-groups), and will otherwise produce an empty href.

The link's text can also be overridden by passing a parameter to the tag e.g.

```html theme={null}
You can unsubscribe by clicking {% unsubscribe_link here %}.
```

Including an `unsubscribe_link` is critical for marketing emails, for both legal and user experience reasons. It should be included in the footer of your email, along with your company name, and address e.g.

```html theme={null}
<mj-text align="center" color="#525252">
  MyCompany, Inc., 40 Rosewood Lane, New York, NY 10003
  <br/>
  <br/>
  Don't want to receive these emails? You can {% unsubscribe_link %} from them here.
  <br/>
  <br/>
  Powered by <a href="https://dittofeed.com" target="_blank" rel="noopener noreferrer">Dittofeed</a>.
</mj-text>
```

### `unsubscribe_url`

If you need to customize the unsubscribe link, you can use the `unsubscribe_url` tag to only output the URL.

```html theme={null}
<a class="df-unsubscribe" clicktracking=off href="{% unsubscribe_url %}" target="_blank">unsubscribe</a>
```

### `subscription_management_link`

The `subscription_management_link` tag outputs a link to the subscription management page without automatically unsubscribing the user. This allows users to manage their subscription preferences manually.

```html theme={null}
{% subscription_management_link %}
```

This renders a link of the form,

```html theme={null}
<a class="df-subscription-management" clicktracking=off href="..." target="_blank">manage subscriptions</a>
```

The link's text can also be overridden by passing a parameter to the tag e.g.

```html theme={null}
You can {% subscription_management_link manage your subscription preferences %}.
```

This tag is useful when you want to provide users with access to subscription management without automatically changing their subscription status upon page load.

#### Channel Display Behavior

The subscription management page accessed via this link will always show subscription groups for all channels, allowing users to comprehensively manage their preferences across email, SMS, and other messaging channels.

### `subscription_management_url`

If you need to customize the subscription management link, you can use the `subscription_management_url` tag to only output the URL.

```html theme={null}
<a class="df-subscription-management" clicktracking=off href="{% subscription_management_url %}" target="_blank">manage subscriptions</a>
```

This tag follows the same channel display behavior as `subscription_management_link` - always showing subscription groups for all channels.

### `view_in_browser_url`

The `view_in_browser_url` tag outputs a URL that allows recipients to view the email in their web browser. This is useful for users whose email clients may not render the email correctly.

```html theme={null}
{% view_in_browser_url %}
```

This renders a URL that can be used in a link:

```html theme={null}
<a href="{% view_in_browser_url %}" target="_blank">View in browser</a>
```

<Note>
  This feature requires [blob storage](/deployment/self-hosted/blob-storage) to be enabled. The rendered email HTML is stored in blob storage when the message is sent, and the URL provides secure access to view it.
</Note>

Example usage in an email header:

```html theme={null}
<mj-text align="center" color="#888888" font-size="12px">
  Having trouble viewing this email? <a href="{% view_in_browser_url %}" target="_blank">View in browser</a>
</mj-text>
```

For more details, see the [View in Browser guide](/guide/view-in-browser).

### `subscription_hidden_fields`

The `subscription_hidden_fields` tag outputs the hidden form fields required for subscription management page form submissions. This tag is only available in custom subscription management page templates.

```html theme={null}
{% subscription_hidden_fields %}
```

This renders hidden inputs for:

* `w` - Workspace ID
* `h` - Cryptographic hash for authentication
* `i` - User identifier value
* `ik` - Identifier key (e.g., `email`, `userId`)
* `isPreview` - Preview mode flag (if applicable)

Example usage in a form:

```html theme={null}
<form class="df-subscription-form" method="POST">
  {% subscription_hidden_fields %}
  <!-- subscription checkboxes here -->
  <button type="submit">Save Preferences</button>
</form>
```

<Note>
  This tag is required for form submission to work correctly. Without it, the subscription management page cannot authenticate or identify the user. See [Custom Subscription Management Page](/guide/custom-subscription-page) for full documentation.
</Note>
