← All guides marginal.sh

Testing Upsell Subject Lines in OpenAI Codex with marginal

Updated June 2026 · Hosted email MCP server

Upsell emails live or die on the subject line. With marginal connected to OpenAI Codex, you can draft variants, launch a subject line A/B test, and read the results without leaving your coding environment.

Why upsell subject lines need their own test

Upsell campaigns target customers who already bought — so the subject line has to feel like a relevant next step, not a cold pitch. Small wording changes ("Add the Pro plan" vs. "Unlock the features you've been missing") can move open rates meaningfully on a list that already trusts you.

Running a subject line test for upsells through marginal means you don't have to guess. OpenAI Codex generates the variants and marginal handles the managed send, tracking, and within-test lift so you know which angle actually earns the upgrade.

Generating upsell variants in Codex

Once marginal is configured as an MCP server in OpenAI Codex, you can ask the agent to produce upsell subject lines and call generate_variants directly. Give it the product, the offer, and the audience — the more context, the better the candidates.

A typical prompt: "Generate five upsell subject lines for customers on the Starter plan, pitching the Pro tier's advanced analytics." Codex calls the tool and returns variants ready to launch.

Launching and reading the A/B test

After you pick the variants, launch_test sends them as a managed campaign with open and click tracking baked in. marginal computes lift between variants inside the test, so you're comparing apples to apples rather than stitching together metrics from a separate dashboard.

When results land, ask Codex to call get_results and summarize. The agent can surface which upsell subject line drove the most opens, then use recommend_next to suggest what to test for the follow-up send — like a different incentive or a sharper deadline.

Fitting it into an AI agent email marketing workflow

Because marginal is a hosted email MCP server, OpenAI Codex talks to it over a single endpoint with a Bearer API key — no self-hosted infrastructure to maintain. That makes it easy to bake upsell subject line tests into a repeatable agent loop: generate, launch, measure, iterate.

Over time you build a library of winning upsell angles backed by real lift data, all driven from the same place you write code. See the setup guide at https://marginal.sh/docs/ to connect Codex and run your first test.

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