EmailTemplate

How to export email templates to Klaviyo

Klaviyo uses Liquid and its own tracking tags. The EmailTemplate klaviyo adapter converts {{ name }} variables to Klaviyo format, wraps links with {% track_link %} and adds {% unsubscribe %} and {{ track_pixel }}. This guide covers exporting through the API and importing into Klaviyo.

API: https://api.emailtemplate.theboomer.dev/api/v1

How do I export an EmailTemplate template to Klaviyo step by step?

  1. Prepare the template in EmailTemplate

    Design in the visual editor or generate with AI. Variables must use the {{ name }} syntax; the adapter normalizes them to Klaviyo format.

    bash
    # Variables detected in the HTML
    {{ user.name }}, {{ order.id }}, {{ order.total }}
    
    # Export the variable list of a template
    curl -s https://api.emailtemplate.theboomer.dev/api/v1/templates/64f8a1b2c3d4e5f6a7b8c9d1/variables \
      -H "x-api-key: $EMAIL_TEMPLATE_API_KEY"
  2. Export with format=klaviyo

    The export endpoint returns content (the snippet), name, mimeType and instructions. The content already includes the tracking tags.

    bash
    curl -s -X POST https://api.emailtemplate.theboomer.dev/api/v1/templates/64f8a1b2c3d4e5f6a7b8c9d1/export \
      -H "Content-Type: application/json" \
      -H "x-api-key: $EMAIL_TEMPLATE_API_KEY" \
      -d '{ "format": "klaviyo" }'
    
    # The content includes:
    #   href="{% track_link %}https://...{% endtrack_link %}"
    #   <a href="{% unsubscribe %}">Unsubscribe</a>
    #   {{ track_pixel }}
  3. Paste the snippet into Klaviyo

    In Klaviyo: Templates > New template > Import code / code editor. Paste the content and save. Variables appear as {{ variable }} in the editor.

    liquid
    {% comment %} email-template-engine — Order confirmation {% endcomment %}
    {% comment %} Variables: {{ user.name }}, {{ order.id }}, {{ order.total }} {% endcomment %}
    <h1>Hi {{ user.name }}</h1>
    <p>Your order <a href="{% track_link %}https://shop.example.com/orders/{{ order.id }}{% endtrack_link %}">{{ order.id }}</a> is on its way.</p>
    {{ track_pixel }}
  4. Import through the API

    The Klaviyo API lets you create or update templates without the editor. Useful for repeatable deployments.

    bash
    curl -s -X POST "https://a.klaviyo.com/api/templates/" \
      -H "Authorization: Klaviyo-API-Key $KLAVIYO_PRIVATE_KEY" \
      -H "revision: 2025-01-15" \
      -H "Content-Type: application/json" \
      -d '{
        "data": {
          "type": "template",
          "attributes": {
            "name": "Order confirmation",
            "text": "Hi {{ user.name }}, your order {{ order.id }} is on its way.",
            "html": "<h1>Hi {{ user.name }}</h1><p>{{ order.id }}</p>"
          }
        }
      }'
  5. Map variables on the profile

    Klaviyo resolves {{ user.name }} against profile properties or campaign variables. Define clear aliases in the editor to avoid confusion.

    bash
    # Suggested profile properties
    first_name, last_name, order_id, order_total
    
    # Or one-off campaign variables
    {{ event.order_id }}, {{ event.order_total }}
Plan limits, AI cost and export to Klaviyo
Item Free Pro Team Enterprise
Monthly price (EUR, VAT excluded) €0€19€59€149
Renders per month 50025,000100,000500,000
Concurrent templates 325UnlimitedUnlimited
Users 121025
AI credits per month 505002,00010,000
AI operation cost generate: 10 credits · suggest: 5 credits. Charged to the credit wallet (they do not consume renders) and the same on every plan. Packs: 500 credits / €9, 2,000 / €29, 5,000 / €69, 10,000 / €119.
Stack provider export format=klaviyo returns HTML (text/html) with {{ variable }} variables, links wrapped in {% track_link %}…{% endtrack_link %}, {% unsubscribe %} and the {{ track_pixel }} pixel.

Subscription prices in USD/month; credit packs are charged in EUR. Product-published data, not estimates.

Frequently asked questions

Does Klaviyo use Liquid or Handlebars?

Klaviyo uses Liquid. The klaviyo adapter normalizes {{ name }} variables and adds the native tags: {% track_link %}, {% unsubscribe %} and {{ track_pixel }}.

Is the open pixel added automatically?

Yes. If the HTML does not contain it, the adapter inserts {{ track_pixel }} before </body>. You can disable it through the adapter options.

How do I update an already imported template?

Export again with format=klaviyo and repeat the import through the API or paste the new snippet. EmailTemplate versioning lets you audit what changed.