← Blog

12 min read · Recovery Pilot

AI-generated emails in your brand voice: the technical deep dive

How Claude analyzes 3-10 of your existing emails and produces a system prompt. Why prompt caching matters at scale. Cost economics at 1000+ emails/month.

When customers receive a recovery email that sounds exactly like the founder wrote it — same casual tone, same sign-off, same idiomatic phrases — conversion rates jump measurably. The mechanism is trust: customers recognize the voice and trust the message.

Getting an LLM to produce that consistently requires more than "write in a friendly tone." Here's the technical approach Recovery Pilot uses.

Step 1: voice extraction (one-time per user)

The user uploads 3-10 sample emails from their outbox. These can be transactional (welcome emails, receipts), marketing (newsletters), or even casual replies — what matters is they were written by the founder, in their voice.

These samples are sent to Claude Sonnet with a system prompt that says: "Analyze the writing voice in these emails. Output a concise system prompt (300-500 words) that another LLM can use to write NEW emails in this exact voice. Focus on: tone, sentence rhythm, signature phrases, structural habits, idiosyncratic word choices. DO NOT analyze topics — analyze VOICE."

Claude returns a system prompt that captures the voice. This system prompt is cached in the user's database row. Total cost: roughly $0.02 in API tokens, runs once per user (or whenever they want to retrain).

Step 2: per-email generation (every recovery email)

When it's time to send a Day 0/3/7/14 email, the engine builds a request that combines two things: the cached voice prompt (the user's tone), and the structural beats for that specific sequence step (the conversion-optimized template skeleton).

Claude receives both as the system prompt, plus a user message with the context (customer first name, failed amount, card last 4, founder first name). It returns the email body as JSON: subject, preview text, and 3-4 paragraphs.

The body is then injected into the React Email layout, which handles the CTA button, signature, and CAN-SPAM footer. The result is a fully personalized email — sounds like the founder, hits the conversion beats, ships in under 2 seconds.

Why two different models (Haiku vs Sonnet)

Day 0 and Day 3 emails are higher volume per customer and more formulaic. Claude Haiku 4.5 generates them at roughly 1/10 the cost of Sonnet with negligible quality drop, because the structural beats do most of the work.

Day 7 and Day 14 are lower volume per customer (only the ones who didn't recover earlier reach these steps) and higher stakes. We use Claude Sonnet 4.6 for these — the extra thoughtfulness shows in the empathy and the closing.

This split keeps the per-customer cost in the $0.01-0.03 range, even with brand voice generation on every email.

Cost economics at scale

A user with 100 customers experiencing ~9% monthly failure rate has ~9 failed payments/month. Most recover at Day 0 or Day 3 — so most of the cost is Haiku generation, roughly $0.01 per email. Even if half escalate to Day 7/14 (Sonnet), the total monthly AI cost per user is around $0.50-1.00.

At $29/mo subscription, that's 1-3% of revenue going to AI inference. Easily sustainable.

At larger scale (10,000 customers per user), prompt caching becomes essential. Anthropic supports cache breakpoints, so the voice prompt (~500 tokens) is cached and not re-billed on every request. Without caching, AI cost would dominate; with it, the math stays in our favor.

Why this beats hand-tuned templates

We could ask the founder to fill in 4 templates manually (Day 0/3/7/14), variable-substitute the customer details, and call it a day. That's what Stunning, ChurnBuster, and every other dunning tool does.

The problem: founders aren't copywriters. The templates they write are mediocre. Worse, the templates feel templated — customers can tell.

By analyzing 3-10 emails the founder already wrote (in real situations, with real voice), we get a much better signal than asking them to write fresh templates. The founder doesn't need to think about tone; we extract it.

That's the difference between a recovery email that converts and one that gets deleted.