Klaviyo Email Campaign Setup
Set up a Klaviyo flow so you can send personalised email campaigns from Flexsee. Flexsee sends a Track event per recipient; a metric-triggered flow in Klaviyo fires and delivers the email.
Prerequisites
- Klaviyo connected in Flexsee (Integrations → Email & SMS)
- A trained model in Flexsee with product recommendations
1. Create the metric-triggered flow
- In Klaviyo, go to Flows → Create Flow → Create from scratch.
- Add a Metric trigger.
- Create or select the metric "Flexsee Campaign Send" (it is created automatically on the first event if it doesn't exist).
- Add an Email action after the trigger.
- Turn the flow Live when you're ready.
2. Configure the email template
In the email step, use these event properties (merge variables) in your template:
| Variable | Description |
|---|---|
{{ event.first_name }} | Recipient first name |
{{ event.last_name }} | Recipient last name |
{{ event.subject }} | Subject line (optional) |
{{ event.flexsee_recommendations }} | Array of recommended products |
{{ event.flexsee_has_recommendations }} | Boolean – use to conditionally show the block |
Product object structure
Each item in flexsee_recommendations has:
productId– product IDtitle– product titleimageUrl– product image URLurl– product page URLprice– price valuerank– recommendation rank (1, 2, 3…)
Example email block (Picked Just For You)
Example email block (Picked Just For You)
Paste into a Klaviyo HTML block. Uses Django syntax (not Shopify limit:). Shows up to 3 products via |slice:"3" — change to |slice:"4" etc. to match products per email.
Responsive: Walkthrough step 6 — desktop snippet (3 columns + @media stack on phones). Klaviyo mobile preview may still show 3 narrow columns; send a test to your phone, or use the optional mobile-only snippet with block Display → Mobile / Desktop.
The example below is a simplified reference; prefer the canonical snippet for production templates.
{% if event.flexsee_recommendations %}
<table role="presentation" cellpadding="0" cellspacing="0" border="0" width="100%" style="max-width:600px;margin:0 auto;font-family:Helvetica,Arial,sans-serif;">
<tr>
<td style="background:linear-gradient(135deg,#f0f9ff 0%,#e0f2fe 100%);border-left:4px solid #6366f1;border-radius:12px;padding:20px 16px 16px;box-shadow:0 4px 14px rgba(99,102,241,0.12);">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-bottom:16px;">
<table role="presentation" cellpadding="0" cellspacing="0" border="0">
<tr>
<td valign="middle" style="padding-right:8px;font-size:18px;line-height:1;color:#6366f1;">
★
</td>
<td valign="middle" style="font-size:20px;font-weight:600;color:#1e293b;line-height:1.3;">
Picked Just For You
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
{% for rec in event.flexsee_recommendations|slice:"3" %}
<td width="33%" valign="top" style="padding:0 6px;">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="background:#ffffff;border-radius:10px;overflow:hidden;box-shadow:0 2px 8px rgba(15,23,42,0.08);">
<tr>
<td style="line-height:0;">
<a href="{{ rec.url }}" style="text-decoration:none;">
<img src="{{ rec.imageUrl }}" alt="{{ rec.title }}" width="168" style="display:block;width:100%;max-width:168px;height:auto;border:0;outline:none;" />
</a>
</td>
</tr>
<tr>
<td style="padding:12px;font-family:Helvetica,Arial,sans-serif;">
<p style="margin:0 0 8px;font-size:15px;line-height:1.35;font-weight:600;color:#111827;">
<a href="{{ rec.url }}" style="color:#111827;text-decoration:none;">{{ rec.title }}</a>
</p>
<p style="margin:0 0 12px;font-size:18px;line-height:1.2;font-weight:700;color:#6366f1;">
{{ rec.currency|default:"" }} {{ rec.price }}
</p>
<a href="{{ rec.url }}" style="display:block;background:#6366f1;color:#ffffff;padding:10px 12px;border-radius:8px;text-decoration:none;font-weight:600;font-size:13px;text-align:center;">
Shop Now
</a>
</td>
</tr>
</table>
</td>
{% endfor %}
</tr>
</table>
</td>
</tr>
<tr>
<td style="padding-top:14px;font-size:12px;line-height:1.45;color:#6366f1;font-style:italic;">
AI-powered recommendations based on your shopping behavior
</td>
</tr>
</table>
</td>
</tr>
</table>
{% endif %}
3. From address and avoiding spam
The From address recipients see is set in Klaviyo, in your flow’s email step (not in Flexsee). To improve deliverability:
- In Klaviyo – Verify your sending domain
Go to Settings → Domains (or Sender / Email authentication). Add your shop’s domain and add the DNS records Klaviyo shows (SPF, DKIM). - In your flow’s email step – Set the From address to your shop (e.g.
Your Shop <hello@yourstore.com>). Use a sender that uses your verified domain so the “From” header matches your brand.
If you skip these steps, campaigns can still send, but more messages may land in spam or promotions.
4. Send from Wizard Flow
When launching an email campaign in Flexsee:
- Open Wizard Flow → Create flow.
- Choose Klaviyo as the destination and complete targeting (product + audience).
- On Destination setup, select the Klaviyo flow you created (triggered by "Flexsee Campaign Send").
- Set subject line and products per email (3, 5, or 7).
- Activate the flow.
Flexsee subscribes eligible recipients to email marketing, then sends one Track event per recipient. Your Klaviyo flow triggers and sends the personalised email.
5. Download campaign audiences
After sending a campaign, Flexsee saves a snapshot of the recipients. You can download the audience as CSV:
- Go to Campaigns.
- In the saved email audiences section, find the campaign you sent.
- Click Download to export the recipient list (userId, email, firstName, lastName, predictionsCount) as CSV.
See Campaigns & attribution for overview metrics.
This is useful for auditing, importing into other tools, or analysing who received each campaign.
Troubleshooting
- Flow not firing – Confirm the flow is Live and uses the "Flexsee Campaign Send" metric. Check Analytics → Metrics in Klaviyo for events.
- Empty recommendations – Ensure recipients are in your training data and the model has been trained.
- No emails received – Recipients must be subscribed to email marketing. Flexsee subscribes them before sending; check the Klaviyo list and profile status.