Skip to Content
ChannelsEmail MarketingEmail Marketing — Channel Overview

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/metadata to get dc (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/... with Authorization: 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/... with api-key: {apiKey}

For v1, Mailchimp is the recommended first target — largest user base, cleanest OAuth, and the most complete analytics API.


What It Enables

CapabilityDetail
Campaign performanceOpen rate, click rate, bounce rate, unsubscribe rate per campaign
Audience growthSubscriber count trend; new vs. unsubscribed over time
List healthBounce rate, spam complaint rate — alert if health degrades
Content attributionWhich email campaigns promoted which blog posts → click-through to site
Agent contextEmail Writer agent sees historical subject line performance → writes better subjects
Insight workerTop campaigns; best send times; subject line patterns that drive high open rates

Workers Needed

WorkerQueueTrigger
email-marketing-sync.worker.ts (new)agent__email-marketing-syncOn channel connect + nightly cron
Feeds into: email-writer.worker.tsHistorical 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:

  1. Overview — list name, subscriber count, avg open rate, avg click rate (last 30 days)
  2. Campaigns — table of all campaigns with open rate + click rate + send date; sort and filter
  3. Audience — subscriber growth chart; churn rate; top segments
  4. Insights — AI-generated email performance summary
  5. Suggestions — subject line recommendations + next campaign idea

Implementation Plan

Phase 1 — Mailchimp Connect + Campaign Analytics

  1. Create packages/providers/mailchimp/src/index.ts:

    • getAuthUrl(callbackUrl, channelId) — OAuth auth URL
    • exchangeCode(code, callbackUrl) — returns token; call getMetadata() for dc
    • getLists(apiKey, dc)GET /3.0/lists — list audiences
    • getCampaigns(apiKey, dc, listId, count, offset)GET /3.0/campaigns with filter
    • getCampaignReport(apiKey, dc, campaignId)GET /3.0/reports/{id} — opens, clicks, bounces
    • getListGrowthHistory(apiKey, dc, listId) — subscriber counts over time
    • verify(apiKey, dc)GET /3.0/ping
  2. Add OAuth routes to apps/api/src/routers/channel-connect.ts:

    • GET /mailchimp/connect → return auth URL
    • GET /mailchimp/callback → exchange code, get dc, redirect to list select
    • GET /mailchimp/page/select → list audiences
    • POST /mailchimp/page/select → save selected audience as subChannelInfo
  3. Create email-marketing-sync.worker.ts:

    • Fetch last 90 days of campaigns + reports
    • Store aggregated metrics in a new EmailCampaignSnapshot model (or ChannelInsight)
    • Pass top campaign data to RAG so Email Writer has context
  4. Update email-writer.worker.ts to query last 5 campaign subject lines + their open rates when the Mailchimp channel is connected

  5. Add seed entry to packages/db/prisma/seed.ts

  6. Create EmailMarketingChannelDetail.tsx

Phase 2 — Klaviyo Support

  1. Create packages/providers/klaviyo/src/index.ts with equivalent methods using Klaviyo API v3

  2. Add Klaviyo seed entry (disabled until Mailchimp is stable)

Phase 3 — Brevo Support

  1. Create packages/providers/brevo/src/index.ts

Phase 4 — Sending from Leadmetrics

  1. 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"], },

© 2026 Leadmetrics — Internal use only