mailtanimailtani

Variables & Personalization

Variables let you insert contact-specific data into email templates. Write {{firstName}} in your email and Correios replaces it with the contact's actual first name when the email is sent.

Basic Syntax

Variables use double-curly-brace syntax: {{variableName}}

Hi {{firstName}},

Your trial ends on {{custom.trialEndsAt}}.

Built-in Contact Fields

These resolve directly from the contact record without the custom. prefix:

VariableDescriptionExample
{{firstName}}Contact's first nameJane
{{lastName}}Contact's last nameDoe
{{email}}Contact's email address[email protected]
{{unsubscribeUrl}}Signed unsubscribe link(auto-generated)

Custom Fields

All other data is stored in custom fields and accessed with the custom. prefix:

{{custom.plan}}
{{custom.trialEndsAt}}
{{custom.dashboardUrl}}
{{custom.hasUploadedVideo}}

Custom fields are created in Settings > Custom Fields and populated by your app when syncing contacts via POST /contacts (using the custom_values object) or when firing events via POST /events (using the properties object).

Fallback Values

If a variable resolves to empty, you can provide a fallback:

Hi {{firstName | "there"}},

If firstName is empty, this renders as "Hi there,".

Chained fallbacks — try multiple variables before falling back to a literal:

Hi {{custom.nickname | firstName | "there"}},

Resolution order:

  1. Try custom.nickname
  2. If empty, try firstName
  3. If still empty, use "there"

Date Modifiers

For date fields, you can format the value directly in the template:

Formatted date (PHP-style format tokens):

Your trial ends on {{custom.trialEndsAt | date:"F j, Y"}}.

→ "Your trial ends on March 23, 2026."

Supported tokens: F (full month), M (short month), j (day), d (day zero-padded), Y (4-digit year), y (2-digit year), n (month number), m (month number zero-padded)

Relative date:

Your trial ends {{custom.trialEndsAt | relative}}.

→ "Your trial ends in 7 days." or "Your trial ended 2 days ago."

Date modifiers apply to the primary variable only — they don't apply to fallbacks.

Spintax

Spintax lets you randomise parts of your email — useful for subject line variation and avoiding duplicate content across large sends.

{{RANDOM | Great news about your account | A quick update | Something you'll want to see}}

Each time the email is sent, one option is picked at random.

Subject line variation:

{{RANDOM | Your trial ends soon | Time is running out | Don't lose your data}}

Body variation:

I wanted to {{RANDOM | reach out | check in | drop a note}} about your account.

Rules:

  • At least 2 options required
  • Options are separated by |
  • No nesting RANDOM blocks inside each other
  • Options can be empty strings (for "include or omit" patterns) — but use carefully

Conditionals

Conditionals let you show different content based on whether a field has a value:

{{#if custom.hasUploadedVideo}}
You've already uploaded a video — great start! Here's what to do next.
{{else}}
You haven't uploaded a video yet. Here's how to get started in 2 minutes.
{{/if}}

Syntax:

{{#if fieldName}}if-branch content{{/if}}
{{#if fieldName}}if-branch content{{else}}else-branch content{{/if}}

Truthy values: Any non-empty, non-zero, non-"false" value is considered truthy. So hasUploadedVideo = "true" is truthy, hasUploadedVideo = "false" is not.

Works with custom fields and built-in fields:

{{#if custom.hasUploadedVideo}}...{{/if}}
{{#if firstName}}Hi {{firstName}},{{else}}Hi there,{{/if}}

Inner variables inside conditional branches are still resolved normally:

{{#if custom.trialEndsAt}}
Your trial ends {{custom.trialEndsAt | relative}}.
{{else}}
You're on a free account.
{{/if}}

When to Use Conditionals vs Flow Nodes

There are three ways to send different content to different contacts in Correios:

MethodBest for
{{#if}} in templateMinor copy variation in a single email (one sentence differs)
Branch node in flowSending substantially different emails to two groups
Audience Filter nodeStopping the flow entirely for contacts that don't qualify

Use {{#if}} when the emails are 90% the same and you're just tweaking one paragraph. The email is simpler to maintain as a single template.

Use a Branch node when the two groups need meaningfully different emails — different subject, different CTA, different framing. Maintaining two separate templates is cleaner than one giant template with big {{#if}} blocks.

Use an Audience Filter when one group shouldn't receive the email at all. If a user has already subscribed, filter them out rather than sending them an email with a big {{#if custom.isSubscribed}}{{else}}...{{/if}} block.

Real Examples (from vitelnk)

Trial end date in email:

Your 14-day trial ends on {{custom.trialEndsAt | date:"F j, Y"}}.
That's {{custom.trialEndsAt | relative}}.

Personalised nudge email subject:

{{RANDOM | Quick question about your trial | Haven't heard from you | Still thinking it over?}}

Upload status conditional:

{{#if custom.hasUploadedVideo}}
You've already shared {{custom.videoCount}} video{{#if custom.videoCount}}s{{/if}} — you know how this works.
{{else}}
You haven't uploaded a video yet. It takes about 2 minutes.
[Upload Your First Video]({{custom.dashboardUrl}})
{{/if}}

Win-back email with reactivation link:

Click below to reactivate your free trial — no credit card required.
This link expires in 7 days and can only be used once.

[Reactivate My Free Trial]({{custom.reactivationUrl}})

Fallback for nickname:

Hey {{custom.nickname | firstName | "there"}},