Newsletter AI Agent, own project
Newsletter AI Agent
Your newsletter written, published, and sent while you sleep
The figures
- Newsletters sentweekly Thursday cadence
- 13+
- Distribution channelsSubstack + Resend Broadcasts
- 2
- Sections per newslettercustom HTML template
- 13
The problem
Writing a consistent weekly newsletter requires hours of curation, writing, and formatting. Most creators give up before month 3.
What I did
Agent that automatically curates content, generates AI summaries, scores subjects to maximize opens, and publishes to two channels: Substack (reverse-engineered API, Markdown→Tiptap JSON, auto-tagging) and Resend Broadcasts (13-section HTML template).
The result
From concept to 13+ weekly editions without missing a beat. The dual system maximizes reach: Substack for organic discoverability and subscriber growth, Resend Broadcasts for full format control and advanced analytics. Weekly Thursday cadence maintains consistent engagement.
The same, for your business
- A clinic that shows up first when people search «dentist near me».
- A garage that gets calls from Maps.
- A law firm that comes up when someone asks an AI assistant.
Technical details
Architecture
- Substack API reverse-engineering: Markdown→Tiptap JSON conversion for direct publishing
- Subject line scoring with Claude Haiku: evaluates clarity, urgency, and relevance
- Responsive 13-section HTML template adapted for email clients
- Weekly stats integration: site metrics automatically included
- Dry-run mode: generates and previews without sending for manual review
Technical decisions
- Claude Haiku 4.5 for generation: minimal cost for curated, not creative content
- Reverse-engineered Substack API vs. email only: maximizes organic discoverability
- Resend Broadcasts as parallel channel: full control over format and analytics
- Thursday cadence: industry data indicates best B2B open rates
How it was built
The agent publishes to two channels simultaneously. For Substack, reverse-engineered the undocumented API: converts Markdown to Tiptap JSON (Substack internal format), applies content-based auto-tagging, and schedules publishing. For Resend Broadcasts, generates a 13-section HTML template (hero, news, tips, tools, site metrics, etc.) and schedules delivery. Subject scoring uses Claude Haiku to evaluate multiple candidates and select the one with highest open potential.
Tech stack
- Claude Haiku 4.5
- Substack API
- Resend
- Supabase Edge Functions
- pg_cron
Features
- Dual publishing: Substack + direct email via Resend Broadcasts
- Automatic curation of relevant industry content
- AI subject line scoring to maximize open rates
- 13-section HTML template: hero, news, tips, tools, and more
- Thursday cadence - the optimal day for B2B newsletters
- Dry-run mode to review before sending