Content Design Blog

On email design and content workflow

How to: Personalization and segmentation

Making your content dynamic with custom ESP code

How to: Personalization and segmentation

ESP code snippets used for segmenting content.

Personalizing your content is most commonly done using either tokens or variables within your copy, or by using if/then definitions of specific situations to show content. In Blocks Edit you can use tokens by just putting in them into your copy.

For your if/then statements, you can add editable code snippets among your content. The code is hidden and shown as a blue bar to indicate where the code breaks occur. To make changes to it, click on the bar to expand the editable code.

Setting up editable code snippets

To setup a custom code section or component for your template use be-code-edit within a code tag:

<code class="be-code-edit">
%%[ IF @member=="True" THEN ]%%
</code>

The code is output in its raw form between your HTML code so it’s ready to use when you export your email for your ESP to parse it.

You can also specify a code block for the head area of your HTML by adding a data-area attribute with head:

<code class="be-code-edit" data-area="head">
%%[ IF @member=="True" THEN ]%%
</code>

The editable code block can have additional code beyond just if/then statements. In fact, it works with any kind of code, including HTML widget code.

Photo of Ovi Demetrian Jr By Ovi Demetrian Jr

Share this post

Tweet | LinkedIn post | Facebook post | Email a team member