Inbox
articleJune 22, 20266 min read

AI-Enabled Transactional Email: Send and Track Email from Any AI Agent

SESMetric now ships an MCP server purpose-built for sending and tracking transactional email from any AI agent. Pair it with 35+ ready-to-send templates and a per-email status API, and your AI agent can fire an email and watch it land, get opened, and get clicked in real time.

By SESMetric Editorial

AI-enabled transactional email: send and track email from any AI agent

Transactional email is the silent backbone of every web app — password resets, welcome emails, receipts, invoice-paid confirmations. Until now, wiring these into a product meant grabbing an SMTP library, hardcoding HTML templates, and building a dashboard to track delivery. AI agents have been absent from that loop entirely.

SESMetric now ships an MCP server purpose-built for sending and tracking transactional email from any AI agent — Claude Code, Cursor, custom agents, anything that speaks the Model Context Protocol. Pair it with 35+ ready-to-send templates and a per-email status API, and your AI agent can fire a password-reset email and watch it land, get opened, and get clicked in real time.

What "AI-enabled transactional email" means

Three pieces have to fit together for an AI agent to usefully send email:

  1. A primitive the agent can call. HTTP REST works, but MCP is the native protocol for modern AI agents. An MCP server lets the agent discover the available tools, read their schemas, and call them with structured arguments — no curl glue code, no brittle string templating.
  2. Templates the agent can pick from. A blank html field is the wrong abstraction for an agent. It wants "send the password-reset template with these variables" — the same way a human developer wants to reuse a known-good template instead of hand-rolling HTML each time.
  3. A way to verify the email landed. "Fire and forget" is not a real integration. The agent needs to confirm the email was delivered, opened, or clicked — and to react if it bounced.

SESMetric now ships all three.

The MCP server

The public MCP server lives at:

https://ai.sesmetric.com/mcp

It exposes four tools:

ToolScopePurpose
list_templatesDiscover the 35+ system templates available out of the box
get_templateRead a template's variables schema before sending
send_emailemail:sendSend an email (template mode or inline)
get_email_statusemail:readGet the full event lifecycle for an email

Authentication is a user-issued API key with the email:send and/or email:read scopes, passed as X-API-Key. Issue one at /dashboard/keys. Admin CMS keys (the kind used by the articles/docs MCP at api.sesmetric.com/mcp) are rejected — the mail surface is its own key scope.

Claude Code config

{
  "mcpServers": {
    "sesmetric-mail": {
      "url": "https://ai.sesmetric.com/mcp",
      "headers": { "X-API-Key": "sk_live_REPLACE_ME" }
    }
  }
}

Once added, the four tools appear under the sesmetric-mail namespace.

Templates work out of the box

A common friction with template-based email services is the clone step: you find a template in the catalog, clone it into your account, then send it. That extra hop makes sense for marketing teams who want to tweak copy, but it's noise for an AI agent that just wants to fire a password-reset email.

SESMetric's 35+ system templates now work directly — no cloning required. When send_email is called with template: "password-reset", the backend resolves the system template by slug and renders it with your branding. Categories include:

  • auth — password reset, email verification, magic link, login alert
  • billing — invoice paid, payment failed, trial expiring, subscription renewed
  • notification — new device, comment mention, weekly digest
  • reminder — abandoned cart, upcoming renewal, task overdue
  • onboarding — welcome, setup checklist, tips
  • generic — blank transactional shell for one-offs

Each template declares its variables schema ([{name, label, sample, required}]). Call get_template(slug) to see exactly which variables a send requires.

Sending an email

Template mode (recommended for agents):

{
  "from_email": "support@yourdomain.com",
  "to": ["user@example.com"],
  "template": "password-reset",
  "variables": {
    "user": { "first_name": "Alex" },
    "reset_url": "https://app.example.com/reset?token=abc123"
  }
}

The agent doesn't need to know HTML. It reads the template's variable schema, fills in the values it has, and lets the server render. Branding (logo, colors, footer, privacy/terms links) is auto-applied from the caller's /dashboard/branding settings.

Inline mode (for one-offs the agent constructs itself):

{
  "from_email": "support@yourdomain.com",
  "to": ["user@example.com"],
  "subject": "Your ticket is resolved",
  "html": "<p>Hey Alex — ticket #421 is closed. Reply if it recurs.</p>"
}

Both return:

{ "id": "msg_3f8c1b2e9a4d4b…", "status": "queued" }

That id is the sm_mail_id — the key the agent uses to track the email's lifecycle.

Tracking the email's status

Most "send email" APIs stop at "queued". For an AI agent that's insufficient — the agent needs to know whether the email actually landed, whether the user opened it, and whether it bounced. SESMetric now exposes:

GET /v1/messages/{sm_mail_id}

Returns:

{
  "sm_mail_id": "msg_3f8c1b2e9a4d4b…",
  "status": "opened",
  "events": [
    { "type": "sent",      "timestamp": "2026-06-22T10:00:00" },
    { "type": "delivered", "timestamp": "2026-06-22T10:00:02", "smtp_response": "250 ok" },
    { "type": "opened",    "timestamp": "2026-06-22T11:14:33", "user_agent": "Mozilla/5.0…" }
  ]
}

Status progresses queued → sent → delivered → opened → clicked. A bounced or complained event overrides — the agent learns the email never landed and can react (retry, contact the user another way, suppress the recipient).

The same data is available as webhooks (delivery, bounce, open, click, complaint events POSTed to your URL with HMAC-signed payloads) for server-side pipelines that prefer push over pull.

Branding auto-applied

Every template render pulls the caller's branding from sm_branding:

  • Logo — header image, omitted if not set
  • Primary color — buttons + accents (default #00a071)
  • Footer HTML — raw block for unsubscribe links, physical address, etc.
  • Privacy policy URL and Terms & conditions URL — when set, a "Privacy Policy · Terms & Conditions" link line is auto-appended to the footer of every template. No per-template wiring required.

Configure at /dashboard/branding. The preview shows the result with your actual brand applied.

A worked agent session

Here is what a Claude Code session looks like with the MCP server configured:

User:       Send a password reset to alex@example.com with token abc123.
Agent:      list_templates({ category: "auth" })
            → [{ slug: "password-reset", variables: [
                 {name: "user", required: true},
                 {name: "reset_url", required: true}
               ]}, …]
Agent:      send_email({
              from_email: "support@yourdomain.com",
              to: ["alex@example.com"],
              template: "password-reset",
              variables: { user: { first_name: "Alex" },
                           reset_url: "https://app/reset?token=abc123" }
            })
            → { id: "msg_3f8c1b2e9a4d4b…", status: "queued" }
Agent:      Email queued. I'll check delivery in a moment.
Agent:      get_email_status({ sm_mail_id: "msg_3f8c1b2e9a4d4b…" })
            → { status: "delivered", events: [{type:"sent",…}, {type:"delivered",…}] }
Agent:      The password reset email was delivered to alex@example.com.

No SMTP library, no HTML templating, no manual status polling — the agent discovers the template, fills the variables, fires the send, and verifies delivery.

When to use the MCP vs the REST API

Both surfaces hit the same backend. Pick based on the caller:

  • AI agents → MCP at https://ai.sesmetric.com/mcp. The agent discovers tools, reads schemas, and calls them with structured arguments. Same key works.
  • Application code → REST at https://api.sesmetric.com/v1/send and https://api.sesmetric.com/v1/messages/{id}. Use when you're wiring transactional email into a server, cron job, or queue worker where MCP tool discovery adds no value.

Webhooks cover both — the same event payload is delivered to your URL regardless of which surface sent the email.

Get started

  1. Sign up at https://sesmetric.com and verify a sender identity (an email or domain at /dashboard/identities).

  2. Upgrade to a paid plan at /dashboard/billing (required for both /v1/send and the MCP send_email tool).

  3. Issue an API key at /dashboard/keys with the email:send and email:read scopes.

  4. Drop the MCP config into your AI client:

    {
      "mcpServers": {
        "sesmetric-mail": {
          "url": "https://ai.sesmetric.com/mcp",
          "headers": { "X-API-Key": "sk_live_REPLACE_ME" }
        }
      }
    }
    
  5. Ask your agent to send an email.

The full API reference — including the REST surface, webhooks, and branding fields — is at https://sesmetric.com/api-reference. The template catalog is browsable at https://sesmetric.com/templates.

Tagsai-agentsmcptransactional-emaildeveloper-toolsemail-api