Post-purchase subject lines in Claude Code
Post-purchase emails — order confirmations, shipping updates, replenishment nudges, and review requests — are some of the highest-open messages you'll ever send. This guide shows how to test their subject lines directly from Claude Code using marginal, the hosted email MCP server.
Why test post-purchase subject lines
Post-purchase moments carry intent that a cold promo blast never will. The customer just bought something, so they're primed to open the next message. That makes the subject line a high-leverage place to experiment: small wording changes can move opens and downstream clicks on cross-sell, reorder, or feedback flows.
Running a subject line A/B test here tells you whether to lead with the order number, the product name, a delivery promise, or a thank-you tone. Instead of guessing, you let real opens and clicks decide.
- Order confirmations: does "Order #1043 confirmed" beat "Thanks — your order is on the way"?
- Shipping updates: urgency framing vs. reassurance framing
- Replenishment reminders: time-based vs. benefit-based hooks
- Review requests: personal ask vs. incentive-led ask
How marginal fits into Claude Code
marginal is a hosted email MCP server, so Claude Code talks to it over the endpoint at https://marginal.sh/mcp with a Bearer API key — there's nothing to self-host. Once connected, the agent can call four tools end to end: generate_variants to draft subject line candidates, launch_test to send the A/B split, get_results to pull open and click metrics, and recommend_next to suggest the follow-up experiment.
Because Claude Code already operates in your project context, you can ask it to design a post-purchase test in plain language and it will orchestrate the tools for you. The free tier covers 100 experiments per month, which is plenty for iterating across your post-purchase flows.
- generate_variants — draft post-purchase subject line options
- launch_test — run the subject line A/B test as a managed send
- get_results — read within-test lift, opens, and clicks
- recommend_next — get the next variant to try
A sample post-purchase test workflow
Here's a typical sequence in Claude Code. You describe the audience and goal, the agent proposes variants, and you launch once you're happy with the framing.
Treat each send as a learning loop: review the lift metrics after enough opens accumulate, then call recommend_next to compound on what worked rather than restarting from scratch.
- Prompt Claude Code: "Generate 4 post-purchase subject lines for a shipping-confirmation email."
- Review the variants and trim to the two strongest angles.
- Launch the subject line A/B test to your recipient segment.
- Wait, then pull results to see which variant drove higher opens and clicks.
- Ask for recommend_next to design the follow-up test on review requests.
Getting the most from AI agent email marketing
AI agent email marketing works best when each test isolates one variable. Keep the audience, send time, and body content fixed so the subject line is the only thing changing — that's how the within-test lift number stays trustworthy.
For setup steps, MCP config, and tool reference, see the marginal docs at https://marginal.sh/docs/. The same Claude Code connection powers every part of the post-purchase journey, from confirmation to reorder.
- Test one subject line variable at a time for clean reads
- Use post-purchase segments where intent is already high
- Let recommend_next chain experiments instead of one-off tests
- Connect once at https://marginal.sh/mcp and reuse across flows
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