Email Marketing — Channel Overview
Platforms: Mailchimp, Klaviyo, Brevo (Sendinblue)
Researched: May 2026
Why This Channel
Email marketing remains the highest-ROI digital channel ($36 return per $1 spent). Every Leadmetrics client running email campaigns — newsletters, promotions, drip sequences — needs to see email performance alongside their content, social, and SEO metrics. Today there is no visibility into email campaign data within the platform.
The Email activity type already exists in the pipeline (the email-writer agent generates content, the DM approves, the client sends via their ESP). The missing piece is feedback: after the client sends the campaign, Leadmetrics has no idea whether it performed well. Connecting the ESP closes this loop — agents learn what subject lines get high open rates, what content drives clicks, what sends get unsubscribes.
Three platforms cover ~80% of SMB email marketing:
- Mailchimp — most common globally and in India; generous free tier
- Klaviyo — dominant in e-commerce (Shopify integrations); higher analytical depth
- Brevo (Sendinblue) — popular in Europe and emerging markets; competitive pricing
Auth Mechanism
Mailchimp
OAuth 2.0 (standard authorization code flow).
- Auth URL:
https://login.mailchimp.com/oauth2/authorize - Token URL:
https://login.mailchimp.com/oauth2/token - After exchange, call
GET https://login.mailchimp.com/oauth2/metadatato getdc(data center prefix) - All API calls:
https://{dc}.api.mailchimp.com/3.0/... - Token does not expire (Mailchimp issues permanent OAuth tokens)
Sub-channel selection: Mailchimp accounts can have multiple Audiences (lists). User selects which audience to connect.
Klaviyo
API Key (v2 private API key from account settings).
- All API calls:
GET https://a.klaviyo.com/api/...withAuthorization: Klaviyo-API-Key {apiKey} - Revision header required:
revision: 2024-02-15
Brevo
API Key from account settings.
- All API calls:
GET https://api.brevo.com/v3/...withapi-key: {apiKey}
For v1, Mailchimp is the recommended first target — largest user base, cleanest OAuth, and the most complete analytics API.
What It Enables
| Capability | Detail |
|---|---|
| Campaign performance | Open rate, click rate, bounce rate, unsubscribe rate per campaign |
| Audience growth | Subscriber count trend; new vs. unsubscribed over time |
| List health | Bounce rate, spam complaint rate — alert if health degrades |
| Content attribution | Which email campaigns promoted which blog posts → click-through to site |
| Agent context | Email Writer agent sees historical subject line performance → writes better subjects |
| Insight worker | Top campaigns; best send times; subject line patterns that drive high open rates |
Workers Needed
| Worker | Queue | Trigger |
|---|---|---|
email-marketing-sync.worker.ts (new) | agent__email-marketing-sync | On channel connect + nightly cron |
Feeds into: email-writer.worker.ts | — | Historical campaign data as context for subject line + content generation |
Insight Worker Output (ChannelInsight)
- Average open rate and click rate over 30 days (vs. industry benchmark)
- Top 3 campaigns by open rate and click rate (last 90 days)
- Subscriber growth / churn trend
- Best performing send days and times
- Subject line patterns with highest open rates (analysed by the AI agent)
- Suggested: next campaign topic + subject line direction based on top performers
Channel Detail Page — EmailMarketingChannelDetail.tsx
Tabs:
- Overview — list name, subscriber count, avg open rate, avg click rate (last 30 days)
- Campaigns — table of all campaigns with open rate + click rate + send date; sort and filter
- Audience — subscriber growth chart; churn rate; top segments
- Insights — AI-generated email performance summary
- Suggestions — subject line recommendations + next campaign idea
Implementation Plan
Phase 1 — Mailchimp Connect + Campaign Analytics
-
Create
packages/providers/mailchimp/src/index.ts:getAuthUrl(callbackUrl, channelId)— OAuth auth URLexchangeCode(code, callbackUrl)— returns token; callgetMetadata()fordcgetLists(apiKey, dc)—GET /3.0/lists— list audiencesgetCampaigns(apiKey, dc, listId, count, offset)—GET /3.0/campaignswith filtergetCampaignReport(apiKey, dc, campaignId)—GET /3.0/reports/{id}— opens, clicks, bouncesgetListGrowthHistory(apiKey, dc, listId)— subscriber counts over timeverify(apiKey, dc)—GET /3.0/ping
-
Add OAuth routes to
apps/api/src/routers/channel-connect.ts:GET /mailchimp/connect→ return auth URLGET /mailchimp/callback→ exchange code, getdc, redirect to list selectGET /mailchimp/page/select→ list audiencesPOST /mailchimp/page/select→ save selected audience assubChannelInfo
-
Create
email-marketing-sync.worker.ts:- Fetch last 90 days of campaigns + reports
- Store aggregated metrics in a new
EmailCampaignSnapshotmodel (orChannelInsight) - Pass top campaign data to RAG so Email Writer has context
-
Update
email-writer.worker.tsto query last 5 campaign subject lines + their open rates when the Mailchimp channel is connected -
Add seed entry to
packages/db/prisma/seed.ts -
Create
EmailMarketingChannelDetail.tsx
Phase 2 — Klaviyo Support
-
Create
packages/providers/klaviyo/src/index.tswith equivalent methods using Klaviyo API v3 -
Add Klaviyo seed entry (disabled until Mailchimp is stable)
Phase 3 — Brevo Support
- Create
packages/providers/brevo/src/index.ts
Phase 4 — Sending from Leadmetrics
- Allow Leadmetrics-generated email content to be pushed directly to Mailchimp as a campaign draft — the DM clicks “Create Campaign in Mailchimp” from the Activity detail page → content is synced as a draft, ready to send
Seed Entries
// packages/db/prisma/seed.ts — CHANNEL_CATALOGUE
{
type: "Mailchimp",
name: "Mailchimp",
iconKey: "mailchimp", // use envelope icon if brand unavailable
description: "Track email campaign performance and inform content strategy with open and click data.",
authenticationType: "oauth2",
requiresUrl: false,
isActive: true,
categories: ["email_marketing"],
},
{
type: "Klaviyo",
name: "Klaviyo",
iconKey: "klaviyo",
description: "Connect Klaviyo to pull email and SMS campaign analytics and audience growth data.",
authenticationType: "ApiKey",
requiresUrl: false,
isActive: false, // enable after Mailchimp is live
categories: ["email_marketing"],
},
{
type: "Brevo",
name: "Brevo",
iconKey: "brevo",
description: "Connect Brevo (Sendinblue) to pull campaign performance and audience data.",
authenticationType: "ApiKey",
requiresUrl: false,
isActive: false,
categories: ["email_marketing"],
},