The email campaign generator
The opt-out and the UTM tagging stopped being things people had to remember.
the problem
Campaign emails were built by hand every time: source the copy, rebuild the layout, get it rendering in Outlook, apply the brand system, tag every link, remember the opt-out. Every step was a place to introduce an error, and the errors were invisible until after send. A mistagged link doesn't look broken — it quietly corrupts campaign reporting.
I timed the manual build at 75 minutes per campaign. On a weekly send that's roughly 65 hours a year rebuilding the same layout.
what I built
- Source copy fetched automatically from a product page URL server-side, or from an uploaded sell sheet, so nothing is pasted by hand.
- The base template lives in the repository and loads every session, so it never has to be re-supplied.
- The brand and technical spec is encoded in the system prompt: 600px table-based centred layout, inline CSS only, Outlook rendering via MSO conditional comments and VML bulletproof buttons, no grid or flex, no web fonts, no background images for critical content, specified colour roles, hidden preheader.
- UTM tagging enforced on every link, with a documented taxonomy of medium names by element type: header logo, hero image, action CTA, document download, section image, section text link, footer logo, footer link, and social by platform. Mailto links, anchors and merge tags are explicitly exempted.
- Placeholder tokens instead of invented URLs. Any asset without a final URL gets a named token, listed in a comment block at the top of the file. The model is forbidden from guessing a URL.
- A self-generated audit trail appended to every output: one line per link, with element, destination and tag.
the idea it's built around
Rather than training people to remember the unsubscribe link and the tagging convention, both were made impossible to omit. The compliance link is a server-side constant the generator can't be asked to leave out. The tagging is audited against the actual output, in code, every run.
where the AI isn't
The audit is deterministic JavaScript parsing the real output HTML. It isn't the language model checking its own work.
outcome
- Campaign email drafted from a product page URL rather than rebuilt from scratch.
- Opt-out compliance can't be omitted, because omitting it isn't a state the system can produce.
- UTM tagging verified deterministically on every output, so attribution data stops silently degrading.
what I'd do differently
Same as the deck generator: the tool shipped before the measurement did. I've since timed the manual baseline properly and instrumented the generator. The compliance argument never needed a number, but the time argument does, and I shouldn't have had to go back for it.
open to marketing operations, analytics and martech roles
Let's talk.
Remote, or Albuquerque and hybrid. Happy to walk through the architecture behind any of this.