Snippets

Save sections of contents to reuse in your campaigns

Snippets can be used when you have pieces of content that you would like to reuse without having to recreate them each time (for instance, a menu structure in an email) or if you want to control the content from a central point so whenever you update the snippet content then that update will be reflected across all future campaigns that reference that snippet.

Creating a snippet

Snippets can be found and managed from Content > Snippets. This page provides buttons to create a new text or HTML snippet.

Text

This option can be used to save content as plain text and is useful for personalisation purposes, rendering attributes linked to a specific user profile or device. It can be used in combination with programmatic syntax to follow the desired logic. Xtremepush uses the Twig syntax for dynamic content. For further information you can review Twig's official documentation.

HTML

You can use this option to save sections of HTML code. When using this feature it is important to bear in mind how this content will fit into the your larger template's HTML. For instance, if you will use snippets for email campaigns, you may need to make sure you include mobile optimised styles to allow the snippet's content to remain flexible when viewed on smaller screens like tablets or mobile phones.

Using a snippet

Once you have created your snippet you will be able to use it in other areas of the platform.

You can insert and see the list of snippets created using the code button from the campaign builder.

Alternatively, when editing campaign messages users can add the snippet token syntax in the place in the builder where the snippet content should be rendered at the time of send. Snippets are referenced using the following Twig syntax:

{{ snippet('snippet_name') }}

For example:

The combined result at send time would then look like this:

👍

Rendering of snippets

Snippets are rendered at send time and so any message which have already been sent will not be affected if you update the content of the snippet, only future campaigns will reflect this change.

Updated 2 months ago


Snippets


Save sections of contents to reuse in your campaigns

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.