HTML Blocks

When creating email templates, you usually need to reuse some parts of the HTML for headers and footers for example. Therefore, Exponea allows you to create custom HTML blocks (also called dynamic blocks, or dynamic content) that you can create once and then easily reuse across your email campaigns.

How to create an HTML block

You can create a new HTML block in in two ways:

  1. Go to Data and Assets > Asset manager > New block
  1. You can also create a new block within the email HTML editor, whether you are building the email in the "Asset manager", "Email campaigns" or through an email node in a scenario. Use the plus sign in the bottom right corner of the editor as shown in the screenshots below.

Creating the content

When creating a new block, simply write the HTML code which you will want to reuse later. The functions available are similar to the normal email HTML builder, including multilingual support.

Inserting parameters

It is also possible to insert parameters into the block. Parameters allow you to insert a custom value within each email separately even when the block has been inserted as a "reference" (see below for explanation).

This will prompt the option to choose the value of the parameter when the block is selected within an email template.

New parameters can be inserted into the code using the method below:

[[ parameterName | default value ]]
  • Replace parameterName with your desired name of the new parameter. It is advised to choose human understandable names for easier identification when choosing the block.
  • default value - the default value to be shown unless changed. Personalization cannot be used here.

Inserting HTML blocks into an email

Using the HTML editor

Click on the "plus" button in the bottom right corner of the editor as shown in the screenshots above.

After clicking on the block you wish to insert in your email, you will be presented with 2 possible methods:

  1. Copy as HTML
    This will take the full code from the default language template and copy it to clipboard. User can the simply paste the code into the desired HTML part. This code can be changed as desired, and will NOT be updated when the block is changed, neither will it consider language variants.
  2. Copy reference
    This will copy the reference to the block in jinja tags, that can be pasted into code. This will not allow changes to the code directly in the HTML and WILL be updated when the block is changed. You will only be able to edit the values of the parameters directly in your email HTML editor.

Please see also below how the block is seen in the HTML code. In the line 5 the block is copied as HTML, in the lines 6 and 7, the block is copied as reference:

Using the visual editor

Drag the "Dynamic content" into the canvas and then choose which block you want to insert.


Inserting parameters into Jinja

If the value of the parameter is to be inserted into a Jinja statement, the double square brackets [[ ]] need to be wrapped with quotes " or '. This is because the parameter value is inserted into the file as text.

{% set paramValue = '[[ parameterName | defaultValue ]]' %}

If the parameter needs to be interpreted as other data type than string, the value may be converted with from_json filter.

{% set paramValue = '[[ parameterName | defaultValue ]]' | from_json %}

Updated 2 months ago

HTML Blocks

Suggested Edits are limited on API Reference Pages

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

We rely on cookies

to optimize our communication and to enhance your customer experience. By clicking on the Accept and Close button, you agree to the collection of cookies. You can also adjust your preferences by clicking on Manage Preferences. For more information please see our Privacy policy.

Manage cookies
Accept & close

Cookies preferences

Accept & close