Customer Support X-ray - The Outreach Strategy
A closed-loop outbound system that sources e-commerce stores, qualifies them cheaply, runs an AI teardown of their support tickets, and emails each owner a personalized card linking to their own result - with every move logged to a team dashboard.
Problem
The Customer Support X-ray tool could already generate a grounded, AI-written teardown of any store's top support tickets - but the missing half was distribution. Waiting for store owners to discover and paste their URL is a slow, passive growth motion. The sharper approach is the reverse: pre-scan the store, then email the owner a link to their own teardown. A cold email claiming "AI could help your support" is noise; one that says "I ran a teardown on your store - ~70% of your tickets look automatable, here's the read" is relevance. The teardown itself becomes the personalization. Getting this right requires more than just sending emails. Every domain let through to the analysis stage costs a real Claude API call, so qualifying candidates cheaply - before any LLM spend - is critical. On top of that, cold email to real businesses carries deliverability and compliance obligations: placeholder addresses that bounce hurt sender reputation, and a single bad data point (like a free-text cost string rendered at headline size) can break the entire card. The system needed guardrails at every stage, not just at the end.
Solution
The pipeline is a five-stage closed loop. First, candidate domains are sourced from hand-curated niche seed CSVs, store-database exports, or a competitor-review miner that scrapes unhappy customers of rival helpdesks like Gorgias and Zendesk - the warmest possible cold leads because fit, budget, and timing are all implied by a low-star review. Second, find_prospects.py scores each candidate on ICP signals (Shopify, Recharge, Gorgias, Klaviyo) using only tech-stack data - no Claude calls - discarding weak fits before any analysis spend. Third, batch_xray.py runs the full Claude teardown on the keepers, upserts results into Supabase, and harvests contact emails from public pages during the same crawl at zero marginal cost. Fourth, outreach.py composes a personalized HTML card - email-safe tables with inline styles, a red-vs-green cost juxtaposition, and the store's top ticket shown as "today vs automated" - and sends it via Resend with dry-run-by-default, per-send logging, and a shared email validator that rejects placeholders, wrong departments, and asset filenames. Finally, the on-site funnel converts the click: the /x/domain teardown page's "Find out more" form captures the lead into Supabase, fires an instant follow-up email via Resend, and optionally pings Slack. Every move is streamed to Supabase run logs and surfaced in a team dashboard with three tabs - Outreach, Enrollments, and a live Activity view that lets you watch a script work through its list in real time. Several hard-won fixes shaped the final design: a shared emailutil validator enforced at harvest, qualification, and send; AI cost figures computed from structured fields rather than rendered from model prose; tech-stack fingerprints tightened to avoid substring false positives; and from __future__ import annotations added throughout to support Python 3.9 on stock macOS.