Back in Stock Subject Line Tests with OpenAI Codex and marginal
Restock emails are some of the highest-intent messages you'll ever send — but a flat subject line buries them in a crowded inbox. With marginal's email MCP server connected to OpenAI Codex, you can generate, launch, and measure back in stock subject lines without leaving your coding environment.
Why test back in stock subject lines from your editor
Back-in-stock notifications convert because the recipient already signaled interest. The variable that decides whether they open is the subject line. Treating it as a guess wastes that intent; treating it as a subject line test turns it into repeatable revenue.
Because marginal runs as an MCP server, OpenAI Codex can call its tools directly. You describe the restocked product and audience in plain language, and the agent handles variant generation, the send, and the results — all inside your normal Codex workflow.
- High purchase intent makes subject line lift especially valuable
- Run a subject line A/B test before the full restock blast goes out
- Keep the loop in OpenAI Codex instead of switching to a separate dashboard
The marginal tools Codex will use
marginal exposes four MCP tools. For a back in stock campaign, OpenAI Codex typically calls them in sequence to move from idea to measured result.
- generate_variants — draft several restock subject lines (urgency, scarcity, plain restock alert)
- launch_test — start the managed subject line A/B test with a sample of your list
- get_results — pull open and click tracking plus within-test lift metrics
- recommend_next — get a data-backed suggestion for the winning angle to send broadly
A back in stock workflow in OpenAI Codex
Once marginal is connected, the AI agent email marketing loop is conversational. A practical sequence for a restocked item looks like this:
- Prompt Codex: 'Generate 5 back in stock subject lines for the Trail Runner sneaker, size 9.'
- Have it call launch_test to send variants to a holdout sample
- Ask for get_results after a few hours to see open-rate lift per variant
- Use recommend_next to pick the winner, then send to the remaining waitlist
Getting connected
marginal is hosted — there's nothing to deploy. Point OpenAI Codex at the endpoint at https://marginal.sh/mcp and authenticate with your Bearer API key (marg_live_...). The free tier covers 100 experiments per month, which is plenty for ongoing restock testing.
Full setup steps and tool references live in the docs at https://marginal.sh/docs/. Add the MCP config to OpenAI Codex, then ask the agent to draft and launch your next back in stock subject line 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.
- 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