Use casesWorkflow

AI Newsletter Agent

Personalized newsletters generated and sent per subscriber. Your AI agent crafts unique editions based on reader interests, handles replies, and adapts content over time — all through a real email address.

The problem

Traditional newsletter platforms send the same blast to every subscriber. Personalization is limited to merge tags like first name or company. The content itself — what stories, what depth, what tone — is identical for everyone on the list.

AI changes this. An LLM can generate a unique newsletter edition for each subscriber based on their reading history, stated interests, and past engagement. But building this requires more than an LLM — you need email infrastructure that lets your agent send from a real address, receive replies, and maintain threaded conversations over time.

Most email APIs are send-only. They were built for transactional notifications, not two-way communication. When a reader replies to ask a question or request a topic, there is nowhere for that reply to land. You end up stitching together multiple services — one for sending, another for receiving, a third for threading — and the result is fragile.

How an AI agent solves this

An AI newsletter agent operates as a loop. Each cycle, it pulls subscriber profiles, generates personalized content using an LLM, sends individual emails, and then listens for replies. When a reader responds — asking for more coverage on a topic, flagging something they disliked, or requesting a change in frequency — the agent processes that feedback and adjusts the next edition accordingly.

  • Generates unique content per subscriber based on interests and engagement history
  • Sends from a real email address — not a no-reply address that kills engagement
  • Receives and processes subscriber replies to refine future editions
  • Threads conversations so each subscriber has a continuous relationship with the newsletter
  • Handles unsubscribe requests, topic changes, and frequency preferences autonomously

How it works with Robotomail

Robotomail gives your newsletter agent a real mailbox with full send and receive capability. You provision a mailbox via the API or CLI, register a webhook for inbound replies, and your agent handles the rest.

Step 1: Send personalized editions. Your agent calls the POST /v1/mailboxes/{mailbox_id}/messages endpoint once per subscriber, with content generated by your LLM.

Send a personalized newsletter
curl -X POST https://api.robotomail.com/v1/mailboxes/{mailbox_id}/messages \
  -H "Authorization: Bearer rm_live_..." \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "to": [
    "reader@example.com"
  ],
  "subject": "Your Weekly AI Digest — March 22",
  "bodyHtml": "<h1>Hey Alex,</h1><p>Here are the AI stories we picked for you this week...</p>",
  "bodyText": "Hey Alex, Here are the AI stories we picked for you this week..."
}
JSON

Step 2: Register a webhook to catch replies. When a subscriber replies, Robotomail delivers the message to your webhook URL with an HMAC-SHA256 signature in the X-Robotomail-Signature header.

Register a webhook
curl -X POST https://api.robotomail.com/v1/webhooks \
  -H "Authorization: Bearer rm_live_..." \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "url": "https://your-app.com/hooks/newsletter-reply",
  "events": [
    "message.received"
  ]
}
JSON

Step 3: Process replies and adapt. Your webhook receives structured payloads with the full message, thread ID, and sender details. The agent can parse feedback, update the subscriber profile, and adjust the next edition.

Inbound webhook payload
{
  "event": "message.received",
  "timestamp": "2026-09-23T10:00:00Z",
  "data": {
    "message_id": "11111111-1111-4111-8111-111111111111",
    "mailbox_id": "22222222-2222-4222-8222-222222222222",
    "mailbox_address": "newsletter-agents@yourcompany.com",
    "from": "reader@example.com",
    "to": [
      "newsletter-agents@yourcompany.com"
    ],
    "cc": [],
    "subject": "Re: Your Weekly AI Digest — March 22",
    "body_text": "Can you include more papers on RAG next week?",
    "thread_id": "33333333-3333-4333-8333-333333333333",
    "received_at": "2026-09-23T10:00:00Z",
    "attachments": []
  }
}

Threading is automatic. Robotomail matches replies using In-Reply-To and References headers, so every subscriber conversation stays organized without extra work from your agent. You can use a platform mailbox like digest@robotomail.co to start, or add a custom domain for full brand control.

Key benefits

  • True personalization: Every subscriber gets a unique edition — not just a different name in a template
  • Two-way engagement: Readers reply directly, and the agent processes feedback to improve future content
  • Automatic threading: Subscriber conversations stay threaded without any custom logic
  • Managed deliverability: DKIM, SPF, and DMARC are auto-configured — newsletters land in the inbox, not spam
  • Simple API: One endpoint to send, webhooks for replies — read the full docs or the launch post to get started

Get started and have your newsletter agent sending personalized editions in minutes. Every plan ships with a 30-day money-back guarantee — validate the concept before you commit.

Connect the workflow to a real reply

The webhook's data.message_id is a database ID used to retrieve or deduplicate a message. Fetch it with the GET message endpoint, then use the response's message.messageId (the RFC Message-ID) as inReplyTo. Keep data.thread_id for your application's conversation state. Do not use a database ID or thread ID as a reply header. Stop and investigate if the fetched message has no Message-ID.

Examples use illustrative IDs. Replace them with IDs from your account; never construct an email Message-ID from a database ID. Exchange mail only between your agent and your verified email address. Upgrade to email anyone. See plans for higher limits.

Verify the webhook signature over the raw body, persist the event and deduplicate on the database message ID before acknowledging it. Run your application logic from a durable queue. The database, calendar, CRM and model functions shown above belong to your application.

This shell example fetches an incoming email and builds all required send fields. Set ROBOTOMAIL_API_KEY, ROBOTOMAIL_MAILBOX_ID and ROBOTOMAIL_MESSAGE_ID in your environment. Apply your recipient and approval rules before sending.

# Requires jq. Use mailbox_id and message_id from the verified webhook.
original=$(curl --fail --silent --show-error \
  "https://api.robotomail.com/v1/mailboxes/$ROBOTOMAIL_MAILBOX_ID/messages/$ROBOTOMAIL_MESSAGE_ID" \
  -H "Authorization: Bearer $ROBOTOMAIL_API_KEY") || exit 1

payload=$(printf '%s' "$original" | jq -e --arg body "Thanks, I received your message." '
  .message | if (.messageId | type == "string" and length > 0) then
    {to: [.fromAddress], subject: ("Re: " + .subject), bodyText: $body, inReplyTo: .messageId}
  else error("Original email has no Message-ID") end
') || exit 1

curl --fail --silent --show-error \
  "https://api.robotomail.com/v1/mailboxes/$ROBOTOMAIL_MAILBOX_ID/messages" \
  -H "Authorization: Bearer $ROBOTOMAIL_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary "$payload"

Read receive and reply and webhook verification for the full setup.

Ready to build this?

Create a mailbox

Create a mailbox and connect one useful workflow. Your application controls the agent and its actions.