← All guides marginal.sh

Referral Program Subject Line Tests with OpenAI Codex

Updated June 2026 · Hosted email MCP server

Pair OpenAI Codex with marginal to draft, launch, and measure referral program subject lines from the same place you write code. marginal is a hosted email MCP server, so your agent calls real tools instead of guessing at copy.

Why test referral subject lines from Codex

Referral campaigns live or die on the open. A subject line that hints at a reward, names the inviting friend, or frames the ask as mutual benefit will pull very different open rates. Rather than ship a single guess, run a real subject line A/B test and let the data pick the winner.

Because OpenAI Codex speaks MCP, you can stay in your workflow: ask the agent to write referral angles, launch the test, and read back lift metrics — no context switch into a separate marketing dashboard.

The marginal toolset for referral campaigns

marginal exposes four MCP tools that map cleanly to a referral program subject line test. You drive them through natural language in OpenAI Codex, and the hosted email MCP server handles sends and tracking.

A practical referral workflow

A typical AI agent email marketing loop for a referral push looks like this. Ask Codex to call generate_variants for your 'invite a friend, you both get a credit' offer, asking for five subject lines across different psychological hooks.

Have it launch_test the strongest candidates, then come back after enough sends to get_results. When you have a clear leader, run recommend_next to refine the winning angle and iterate. The free tier covers 100 experiments per month, which is plenty to find a reliable referral hook.

Getting connected

Point OpenAI Codex at the marginal endpoint at https://marginal.sh/mcp and authenticate with your Bearer API key (marg_live_...). marginal is fully hosted, so there is nothing to deploy or self-host. Setup details live in the docs at https://marginal.sh/docs/.

Once connected, your referral program subject line tests run through the same agent you already use to ship features — see https://marginal.sh/mcp for the registry entry and tool reference.

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