For Email Marketing Specialists ·
What you'll accomplish
By the end of this guide, you'll have a weekly email performance report that writes itself — pulling campaign data from your ESP, sending it to the Claude API for analysis and narrative writing, and delivering a polished report to your inbox or Slack channel every Monday morning. No manual data pulling, no writing the same narrative structure week after week.
What you'll need
Klaviyo:
Campaigns:Read, Metrics:ReadMailchimp:
HubSpot:
content (for email campaigns), reports (for analytics)Log into zapier.com → Create Zap
Trigger: Schedule by Zapier → Weekly → Monday → 8:00 AM
Action 1: Pull Campaign Data from ESP
https://a.klaviyo.com/api/campaigns/?filter=equals(status,"Sent")&filter=greater-than(send_time,{{1_week_ago}})Authorization: Klaviyo-API-Key [your key], revision: 2024-02-15Action 2: Format the Data
const campaigns = JSON.parse(inputData.response_body);
const summary = campaigns.data.map(c => ({
name: c.attributes.name,
send_time: c.attributes.send_time,
open_rate: c.attributes.tracking_options.open_rate,
click_rate: c.attributes.tracking_options.click_rate,
}));
return { summary: JSON.stringify(summary) };
Action 3: Send to Claude API
https://api.anthropic.com/v1/messagesx-api-key: [your Claude API key], anthropic-version: 2023-06-01, content-type: application/jsonAction 4: Extract the Report Text
content[0].text (extracts Claude's response from the JSON)Action 5: Send the Report
Common issues:
claude-haiku-4-5-20251001 for weekly reports (fast and cheap) — only upgrade to Sonnet for complex monthly analyses{
"model": "claude-haiku-4-5-20251001",
"max_tokens": 1000,
"messages": [{
"role": "user",
"content": "You are an email marketing analyst. Write a weekly performance report based on the following campaign data. Format as: (1) Executive Summary - 2 sentences, (2) Campaign-by-Campaign Results - bullet points, (3) Week's Highlight - best performer and why, (4) One Concern - lowest performer or concerning trend, (5) This Week's Recommendation - one specific action to take.\n\nUse these benchmarks: open rate baseline 22%, CTR baseline 2.5%.\n\nCampaign data: {{summary}}"
}]
}