Ship SaaS Lifecycle Emails From Claude Code or Cursor

Kevin Scotton October 4, 2026

Short answer: connect Audienceful's email marketing MCP server to Claude Code or Cursor with one command, then ask your coding agent for the lifecycle emails in plain language. In one session it can create the custom fields your app needs, build the onboarding sequence around a custom event (created paused), add the event call to your signup code, and fire a test event at your own address. Nothing sends to customers until you turn the sequence on.

Lifecycle email is the job SaaS founders put off longest. The product ships, the onboarding emails stay on a to-do list, because setting them up means leaving the editor, learning another tool's data model and remembering which event name you used in the code. A coding agent with access to both your repo and your email platform removes most of that context switch.

This guide walks through it with Claude Code. Cursor, VS Code and Codex work the same way once they're connected.

What you'll have at the end

  • Custom fields such as plan and signup_source on your contacts
  • A trial_started event your app fires on signup
  • A four-email onboarding sequence triggered by that event, reviewed and switched on by you
  • A test run through the sequence, sent to your own inbox

Allow about 30 minutes, most of it reading drafts.

Step 1: Connect Audienceful to your coding agent

Claude Code. Run this once, and the server is available in every project:

Bash
claude mcp add --transport http --scope user audienceful https://api.audienceful.com/v2/mcp

Start claude, run /mcp, select audienceful and choose Authenticate. A browser window opens. Sign in, pick the workspace and choose what the agent can do. For this guide, allow view and edit. You can leave send off.

Cursor. Add the server to ~/.cursor/mcp.json (or .cursor/mcp.json for one project):

JSON
{
  "mcpServers": {
    "audienceful": {
      "url": "https://api.audienceful.com/v2/mcp"
    }
  }
}

Then open Cursor Settings → Tools & MCP and click Needs login next to Audienceful. Full setup for VS Code and Codex is on the Claude Code and Cursor page.

No account yet? Start free. The free plan covers up to 1,000 contacts and includes the MCP server.

Step 2: Model your data

Start by asking the agent what's already there, then let it fill the gaps:

"Look at our Audienceful workspace and tell me which custom fields and tags exist. Then look at our User model and create Audienceful fields for anything we'll want to segment on, like plan and signup source."

The agent calls list_fields and list_tags, reads your model in the repo, and creates what's missing with create_field. Fields matter more than they look: Audienceful only stores data on a contact when a matching field exists, so creating plan now is what lets you segment on it later.

To seed a few real contacts for testing, ask it to add them with upsert_contact. It never re-subscribes someone who has unsubscribed.

Step 3: Build the onboarding sequence

Describe the sequence the way you'd brief a person:

"Build an onboarding automation triggered by a custom event called trial_started. Email 1 right away: welcome, and the one thing to do first (connect a data source). Wait 2 days, email 2: the feature most trial users miss. Wait 3 days, email 3: a customer story. Wait 5 days, email 4: the trial ends soon, with a link to upgrade. Tag everyone who finishes as onboarded. Use our product's voice from the README. Leave it paused."

Behind the scenes, the agent reads get_automation_reference to see which triggers and steps your workspace supports, then calls create_automation with the event trigger, waits, emails and tag step. Each email is a real draft in Audienceful's editor, on your brand theme, so you or a teammate can tweak the copy there. New automations are always created paused.

Want different paths for different users, like a shorter sequence for people on the Pro trial? Ask for a branch on the plan field and the agent builds it into the same automation.

Already on Stripe? You can trigger on billing events instead of your own, such as a trial starting, a trial about to end or a failed payment. Our trial-to-paid recipe has a ready prompt for that.

Step 4: Wire the event into your app

This is the step a coding agent is best placed to do, because it can see your code:

"Add a call to Audienceful's trigger event endpoint in our signup handler, firing trial_started with the user's email and plan. Read the API key from an environment variable."

The agent adds something like this to your backend:

JavaScript
await fetch("https://api.audienceful.com/v2/automations/event", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-Api-Key": process.env.AUDIENCEFUL_API_KEY,
  },
  body: JSON.stringify({
    email: user.email,
    event: "trial_started",
    add_person: true,
    fields: { plan: user.plan, signup_source: user.source },
  }),
});

add_person creates the contact if they're new, and fields sets their data in the same call. Keep the API key on the server; it should never reach the browser. The full reference is in the trigger event docs.

Step 5: Test it on yourself

Open the automation in Audienceful, read each email and switch it on when you're happy. Then go back to the agent:

"Trigger trial_started for me@yourcompany.com so I can check the first email."

The agent calls trigger_custom_event and the first email lands in your inbox within a minute or two. To check a single email without running the whole sequence, ask for a test send of that draft. It goes to up to five addresses you name, never to your list.

Receipts and password resets

Lifecycle emails are marketing email: people can unsubscribe, and they go to contacts in your list. Receipts, login links and password resets are transactional and should always arrive. Build those in Audienceful and send them from your backend with the transactional email API. Your agent can write that integration too, and it can send transactional emails through the MCP server when you want to try one by hand. See transactional email for how it works.

Prompts to keep

  • "Which automations are active, and how many people are in each?"
  • "Create an audience of trial users on the Pro plan who signed up in the last 14 days. How many is that?"
  • "Duplicate the onboarding sequence for our annual plan and change email 4 to talk about the yearly discount. Leave it paused."
  • "How did the onboarding emails perform over the last 30 days? Which one has the lowest click rate?"
  • "Add a custom event called project_created and build a one-email nudge for anyone who started a trial 3 days ago and hasn't fired it."

More ready-made prompts are in our AI email prompts library.

What your agent can't do (on purpose)

  • Turn on automations without you. Activating one needs the send permission and an explicit confirmation. With send left off, you switch sequences on in Audienceful.
  • Send a campaign silently. A send to your list needs a preview of the exact recipients and timing, and your approval works once, for those people only.
  • Re-subscribe anyone. Unsubscribed contacts stay unsubscribed, whatever the agent or an import says.
  • Reach another workspace. Each connection is scoped to the one workspace you picked at sign-in.

You can disconnect the agent any time from Apps → Installed apps in Audienceful.

Why do this in Audienceful

  • One tool for product and marketing email. Lifecycle sequences, newsletters and transactional email share the same contacts, editor and reporting.
  • Native Stripe data. Segment and trigger on subscription and payment events without a webhook pipeline. See email marketing for SaaS.
  • Simple pricing. Free up to 1,000 contacts, then paid plans from $29/month billed yearly ($37.50 monthly) for 3,000 contacts. See pricing.
  • The MCP server is on every plan, including Free, and it doesn't use Audienceful AI credits. Your teammates can use the same tools from Claude or ChatGPT, or with the AI agent built into Audienceful.

Start free and connect your coding agent in a minute.

FAQs

Can Claude Code do email marketing?

Yes, once it's connected to an email platform with an MCP server. With Audienceful connected, Claude Code can create contacts and fields, build audiences and automations, draft emails and report on results. It sends to your list only after you approve a preview.

Does this work in Cursor?

Yes. Add https://api.audienceful.com/v2/mcp to Cursor's mcp.json, sign in from Settings → Tools & MCP, and use the same prompts. It also works in VS Code, Codex and Gemini CLI.

Do I need the API if I use the MCP server?

For setup, no: the agent builds everything through the MCP server. Your app still calls the REST API at runtime to fire events and send transactional email, because that happens when users sign up, not during a chat.

Is it free?

The MCP server is included on every Audienceful plan, including Free, which covers up to 1,000 contacts.

Email? Easy.

Audienceful is how smart companies do AI email newsletters, marketing automation, and transactional email.

The Audienceful editor