Introduction
Producing a newsletter is a humble but time-consuming job. You draft the copy, pick the products, paste in prices and images, and finally shape it into HTML that won't fall apart. That last part — "HTML that won't break" — is the real trap. Write it the way you'd build a web page, and it can look like a mess the moment someone opens it in Outlook.
So for the newsletters of an EC business selling motorcycle gear, I built in automatic HTML generation by AI. The key idea is this: AI does the groundwork all the way to email-safe HTML, and humans just review and send.
This article walks through the overall picture, and why it's worth bringing AI into newsletter production in the first place.
Why use AI for newsletter production
Email HTML is a different world from the web
First, some context: HTML for email is nothing like HTML for the web. You can't use external CSS or JavaScript, layouts have to be built with nested table tags (a relic these days), and every style has to be written directly on the element as inline CSS. The reason is rendering differences across email clients — ignore them and the display breaks depending on the environment.
Honoring these rules by hand every single time is genuinely exhausting. That's exactly why it's worth having a machine enforce the constraints. I dig into this in Why Email HTML Is Special.
The "look it up and paste it" work is what I want to automate
What eats up time in newsletter production isn't so much the writing — it's the "look it up and paste it" work. What's this product's current price? Which image URL? What's the product page link? By hand, that means bouncing between admin screens for each product, and a single copy-paste slip means announcing a wrong price to customers.
Let AI write the copy, and let the system insert prices and images accurately from the product master. This division of labor eliminates the tedious, error-prone part wholesale.
Humans focus on review and sending
That said, shipping AI's output straight to inboxes is risky. Is the tone on-brand? Is the pitch appropriate? Those are judgment calls that belong to a human.
So this system has AI prepare the groundwork HTML, a human review it and give correction instructions, and only then send. People move from "building from scratch" to "finishing," which lets them focus on judgment.
Copy and HTML built by hand. Prices and image URLs are copy-pasted from admin screens each time, inviting paste errors and broken layouts.
AI generates email-safe HTML, and the system inserts prices and images accurately. Humans focus on review and sending.
The overall picture of the system
From generation to delivery
Give the system a newsletter theme and the products to feature, and AI generates email-safe HTML, which a human then reviews and sends. The generated HTML is validated, and if there are no issues, it's pasted into the MA tool for delivery.
Enter the newsletter plan (theme and featured products).
Pull prices, image URLs, and product links accurately from the product master DB.
AI generates HTML that honors the constraints and applies the per-brand template.
Validate the output; a human checks the content and gives corrections.
Paste into HubSpot and send. Progress is posted to Slack.
Draw a clear line around what AI doesn't touch
The heart of this system is a firm split between "what AI handles" and "what the system guarantees." AI is great at generating copy and assembling HTML, but letting it write data that has to be exact — like prices and URLs — is dangerous. LLMs will happily "invent" a price.
So prices, image URLs, and product links are never touched by AI; instead, values fetched from the product master DB (Neon Postgres) are inserted by the system. AI builds the vessel, and the database fills in the facts.
Automatic per-brand templates
This EC business handles two brands, and the newsletters differ in header and footer design per brand. Swapping them by hand every time is tedious, so specifying a brand applies the template automatically. AI only generates the body; the header and footer are a fixed form the system slots in.
The principle of division of labor
AI builds the "copy and structure," and the system guarantees the "accurate data and brand form." This dividing line is the foundation of newsletter automation you can trust.
What we learned from adopting it
Production time and mistakes drop together
The most obvious win is shorter production time. What used to take hours per newsletter is now much faster, since you start from AI-prepared groundwork. And because the system inserts prices and images, copy-paste mistakes have nearly vanished. Faster and less error-prone at the same time — that combination is the big one.
How to guarantee "unbreakable HTML"
The hard part was getting AI to write email-safe HTML every time. Relax for a moment and it reaches for div layouts or external CSS. We handled this by instructing the constraints strictly in the prompt and validating the output before use. I cover this in Getting AI to Write Email HTML That Doesn't Break.
A deliberate compromise built around review
This system doesn't aim for full automation. A human always reviews before sending, because AI output sometimes carries a tonal slip or a subtle oddness. By not being greedy about full automation and settling on "groundwork only," it became a tool we can comfortably use day to day.
Summary
Bringing AI into newsletter production isn't about "letting AI write everything" — it's about "AI does the groundwork, humans review and send," which cuts both production time and mistakes at once.
- Email HTML is a different world from the web; you must honor
tablelayouts andinline CSS. - Data where accuracy is critical, like prices and URLs, is guaranteed by the system — never invented by AI.
- Per-brand templates are applied automatically, in a review-first flow with Slack notifications.
Each topic is explored in the sub-articles below.
Why Email HTML Is Special — Constraints for Unbreakable Layouts
Rendering differences across email clients, and why table layouts and inline CSS are required.
Getting AI to Write Email HTML That Doesn't Break
Enforcing the constraints through prompts and validating the output before use.
Product Data Integration and a Review-First Workflow
Inserting prices, images, and links from the product master, with human review before sending.