Reusing Content With Snippets

Reusing Content With Snippets


With Customer.io, you can share common chunks of content across your emails, text messages, and more with Snippets. Snippets are supported everywhere Liquid can be used.

Creating Snippets

To create the first Snippet in your workspace :

  • Log in and choose Workspace Settings from the left panel then scroll down and click Snippets in the Sending Options section of that page
    Left navigation and Workspace settings

  • Click the Create New Snippet button under the Snippets panel

  • Enter a name and value for the Snippet

  • Click the Save button

Spaces are allowed in Snippet names, however, we recommend using underscores or hyphens to separate words as this will make them less prone to errors when used in your message templates.

Create a new Snippet

List Snippets

The Liquid tag for using the Snippet will automatically update as you update the Snippets name and content.

Using Snippets

Snippets may be used anywhere that Liquid may be used. This includes layouts, email bodies, subjects, slack messages, and more. The syntax is the name of your Snippet prefixed by the word snippets. If your Snippet name contains spaces, you can use the bracket notation instead:

{{snippets.address}}
{{snippets["main address"]}}

Using Snippets

Frequently asked questions

  1. Can I include Liquid within a Snippet? Yes, any Liquid within a Snippet will render in your message normally. For example, adding {{customer.id}} to your Snippet content will result in the Person's id attribute value being displayed wherever the Snippet is used.
  2. Can I change the name of a Snippet? No, Snippet names can't be changed. To use a different name, copy the Snippet body and create a new Snippet.
  3. Can I include HTML within a Snippet? Yes, any HTML within a Snippet will render in your message normally. Note that the HTML from your Snippets will only render properly in environments where HTML is allowed. (I.e., HTML in a subject line will not render. Only the raw code would be seen in the output.)
Was this article helpful?