Referral Program Subject Line Tests with OpenAI Codex
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.
- Generate referral angles: reward-led, friend-led, urgency-led
- Compare variants with a controlled subject line A/B test
- Track opens and clicks per variant with within-test lift
- Keep the loop tight inside OpenAI Codex
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.
- generate_variants — produce distinct referral subject lines from one brief
- launch_test — start a managed send that splits traffic across variants
- get_results — pull open/click rates and within-test lift
- recommend_next — get a data-backed suggestion for the next round
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.
- Brief: state the offer, audience, and tone once
- Generate: a spread of referral subject lines, not minor rewordings
- Launch: split sends evenly so lift is comparable
- Decide: use within-test lift, then iterate with recommend_next
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.
- 100 experiments/month on the free tier
- Four MCP tools: generate_variants, launch_test, get_results, recommend_next
- Listed in the MCP Registry as sh.marginal/mcp