Mailfois
Klaviyo

Klaviyo email coding cheat sheet

The tags and rules you need to code an email or a module for Klaviyo: the unsubscribe link, personalisation with a fallback, the view-in-browser and address tags, editable regions and how to get your HTML in. Checked against Klaviyo's own documentation on 27 October 2026.

Unsubscribe
{% unsubscribe %} (or <a href="{% unsubscribe_link %}">Unsubscribe</a>)
First name
{{ first_name }} (Django template language)
With a fallback
{{ first_name|default:'there' }}
View in browser
{% web_view %} (or {% web_view_link %} for the address only)
Preferences
{% manage_preferences %}
Postal address
{{ organization.full_address }}

The Klaviyo unsubscribe link

Put this in the footer of every marketing email you code for Klaviyo:

{% unsubscribe %} (or <a href="{% unsubscribe_link %}">Unsubscribe</a>)
  • Marketing templates must include {% unsubscribe %} or {% unsubscribe_link %}.

The law in most countries also wants the unsubscribe to be easy to find and free to use: see the email rules by country.

Personalisation in Klaviyo: first name with a fallback

Klaviyo uses Django template language. A first name on its own:

{{ first_name }}

With a fallback, so an empty field never shows a blank or a raw tag:

{{ first_name|default:'there' }}

Showing something only to some people (an if / else):

{% if person|lookup:'Loyalty Points' > 0 %}You have points{% else %}Join the club{% endif %}
  • View in browser: {% web_view %} (or {% web_view_link %} for the address only)
  • Preferences: {% manage_preferences %}
  • Postal address: {{ organization.full_address }}

Making a coded template editable in Klaviyo

A hybrid template: each <td data-klaviyo-region="true"> is one drag-and-drop region (width in pixels); klaviyo-block divs inside it start as text or image blocks. The HTML around the regions stays fixed.

<tr><td align="center" data-klaviyo-region="true" data-klaviyo-region-width-pixels="600"><div class="klaviyo-block klaviyo-text-block">Hello world!</div></td></tr>

Getting your HTML into Klaviyo

Content > Templates > Import: name it and upload the .html file, with a ZIP of local images under "Upload additional files". Images are moved to Klaviyo's CDN and the references updated.

Limits worth knowing

  • Uploads must be .html files; each image 10 MB or smaller.
  • Image paths in the ZIP must match the references in the HTML exactly.
  • Tags from other platforms are not supported and must be replaced before import.

What Klaviyo calls things

Every platform has its own words for the same ideas. Klaviyo's, in plain English:

The ideaKlaviyo calls itWorth knowing
One-off sendCampaignA one-time message sent to a chosen list or segment at a time you schedule. Campaigns batch-send; flows send per profile. Not interchangeable.
Automated journeyFlowAn automated sequence of steps set in motion by a single trigger. Flows also update properties and fire webhooks, not just send.
Trigger / entryFlow triggerThe event, list join, segment join, date property or price drop that starts a flow. One trigger per flow. Entry restrictions are separate flow and trigger filters.
Static groupListA collection of profiles added by form, integration, API or manual upload. Not truly static, people unsubscribe out, and suppressed profiles still appear on it.
Dynamic groupSegmentA group defined by conditions that adds and removes profiles automatically. Segments cannot collect consent, only lists can.
Customer recordProfileThe record for one contact: properties, consent status and full activity feed. “Active profile” is a billing term and won’t match your list counts.
Custom fieldProfile propertyA field you create to store extra information, such as size or birthday. Properties with spaces or $ need lookup notation, not dot notation.
Behavioural eventMetricAn action someone takes, such as Placed Order, used for segmenting and triggering. “Metric” means an event type here, not a performance statistic.
Reusable blockUniversal contentA block saved once and reused across templates, with edits propagating everywhere. Saved content is an unlinked copy; universal content stays linked.
TemplateEmail templateThe saved contents of an email, usable in a campaign or flow message. Editing a template does not update messages already built from it.
Personalisation languageDjango template languageKlaviyo personalises using Django syntax: {{ variables }}, {% tags %} and filters. Django, not Liquid, Jinja or Handlebars. Variables cannot contain spaces or hyphens.
Fallback valuedefault filterA template filter supplying placeholder text when a variable is empty. Filter order matters, filters before default don’t affect the fallback.
A/B testA/B test (variations)Comparing message variations on open or click rate. “Winning variation” sends one winner; “personalized variations” picks per recipient.
SuppressionSuppressed / suppression listA profile blocked from email marketing after unsubscribing, hard bouncing or manual addition. Suppression is global and separate from consent, suppressed people still show on lists.
Frequency cappingSmart SendingSkips anyone who already received a message on that channel within a recent window. The closest thing to frequency capping. Defaults: 16 hours email, 24 SMS.
TransactionalTransactional designationA per-message setting for user-triggered informational emails containing no marketing content. Set per message, only in metric-triggered flows, and needs Klaviyo approval.
Preference centreManage preferences pageA hosted page where recipients choose which messages they want. List-specific pages only apply to single-list campaigns.
Send-time optimisationSmart Send TimeFinds one best hour for your audience; Personalized send time optimises per recipient. Easily confused with Smart Sending, a completely unrelated feature.
ReportingAnalyticsCustom reports, dashboards and Benchmarks. Benchmarks compares you against similar companies, not your own past performance.
Imported data tableCustom objectsMulti-field records imported into Klaviyo; product data uses Catalog instead. Requires Advanced Klaviyo Data Platform, billed separately.
API-triggered sendCreate Event APIYou post an event, which triggers a flow. Flows can also push webhooks out. There is no “send this email now” API.
Draft vs liveDraft / Manual / LiveDraft never sends, Manual queues for human review, Live sends automatically. Status is per message, a live flow full of draft messages sends nothing.

What we couldn't confirm

We only list what Klaviyo's documentation says. These points weren't clear from it, so test them in your account:

  • Whether Klaviyo inlines CSS from <style> blocks in imported HTML was not stated in the docs read.
Do it in Mailfois. Ask Mailfois, your email marketing assistant, writes modules and whole templates for Klaviyo with these tags, fallbacks and editable regions already in place. Studio adds the unsubscribe and privacy links before you copy the code, and Brand Guard flags merge tags left without a fallback. How Ask Mailfois works

Questions

What is the unsubscribe tag in Klaviyo?

{% unsubscribe %} (or {% unsubscribe_link %}). Marketing templates must include {% unsubscribe %} or {% unsubscribe_link %}.

How do I add a first name with a fallback in Klaviyo?

Klaviyo uses Django template language. A first name is {{ first_name }}, and with a fallback: {{ first_name|default:'there' }}

How do I add a view-in-browser link in Klaviyo?

Use {% web_view %} (or {% web_view_link %} for the address only).

How do I get a custom HTML email into Klaviyo?

Content > Templates > Import: name it and upload the .html file, with a ZIP of local images under "Upload additional files". Images are moved to Klaviyo's CDN and the references updated.

Sources

Checked by Mailfois against Klaviyo's documentation on 27 October 2026. Platforms rename things often: spotted something out of date? Email [email protected].

Other platforms

Mailchimp · HubSpot Marketing Hub · Salesforce Marketing Cloud Engagement · Braze · Adobe Marketo Engage · Bloomreach Engagement · Brevo · Constant Contact · Campaign Monitor · Dotdigital · Iterable · Resend

Code for Klaviyo without looking up the tags.

Start with Ask Mailfois