← All guides marginal.sh

Testing Win-Back Subject Lines with OpenAI Codex and marginal

Updated June 2026 · Hosted email MCP server

Win-back campaigns live and die by the subject line. This guide shows how to run a win-back subject line test directly from OpenAI Codex using marginal, the hosted email MCP server, so your AI agent drafts variants, launches a real A/B test, and reports the winner.

Why win-back needs its own subject line approach

Lapsed subscribers have already tuned out your usual cadence, so reactivation hinges on a subject line that feels different from your everyday sends. A win-back subject line test lets you find the angle that actually pulls people back — whether that's a discount hook, a 'we miss you' tone, or a feature update they've never seen.

Running this from OpenAI Codex keeps the whole loop in your editor: you describe the audience, the agent proposes variants, and marginal handles the send and measurement.

Generating win-back variants in OpenAI Codex

With marginal connected as an MCP server, OpenAI Codex can call generate_variants to draft a batch of win-back subject lines tuned to your segment. Give it context — how long subscribers have been inactive, what offer you're extending — and it returns distinct options to test rather than near-duplicates.

Because Codex is right in your workflow, you can iterate on the prompt and regenerate until the angles match your brand voice before committing to a launch.

Launching and reading the subject line A/B test

Once you have your shortlist, launch_test ships the win-back A/B test through marginal's managed sends, then get_results streams back open and click metrics with within-test lift so you can see which subject line is reactivating the most lapsed contacts.

When you want a clear next step, recommend_next tells you which variant to roll out — useful when the agent is driving AI agent email marketing decisions without you eyeballing every number.

Connecting marginal to OpenAI Codex

marginal is fully hosted, so there's no self-hosted MCP server to maintain — you point OpenAI Codex at https://marginal.sh/mcp and authenticate with a Bearer API key (marg_live_...). From there the four tools are available to your agent.

See the docs at https://marginal.sh/docs/ for setup details and tool schemas, and connect via https://marginal.sh/mcp.

Get started with marginal

marginal is a hosted email marketing MCP server at marginal.sh. Sign up free, create an API key, and connect https://marginal.sh/mcp from Cursor, Codex, or Claude Desktop.

Documentation · Sign up · FAQ