← Back to AI Workflow
Product Marketing · Portfolio project

An AI system that writes, sends, and improves marketing content — on its own

Give it a topic and an audience. It drafts a blog, writes a tailored newsletter for each persona, sends them through a CRM, tracks what performs, and uses the results to decide what to publish next — a loop that gets sharper every round.

by I-Wen (Elaine) Lee  ·  demonstrated on two real companies — Zip & Shopify  ·  Python · Claude · HubSpot · runs with zero API keys
How it works

One topic in. A self-improving loop out.

An AI system that writes, sends, and improves marketing content — on its own A blog idea goes in. A tailored newsletter goes out to each audience. Results loop back to make the next one better. 1 WRITE AI drafts the blog and a separate version for each type of reader. 2 SEND Each reader gets the version made for them, through the CRM. 3 MEASURE See what people opened and clicked — for each audience. 4 IMPROVE Those results decide what to write next — automatically. every round gets smarter
The problem

Content marketing is usually a broken manual loop

Companies grow inbound through content, but in practice three things quietly break it:

01

Segmentation lives in someone's head

A CFO and a first-time founder care about different things, but tailoring per audience is slow — so teams default to one generic blast.

02

The steps don't talk

Ideate, write, send, and measure are disconnected. Whoever picks next week's topic rarely knows what actually performed last week.

03

Results don't feed back

Data gets reported and forgotten. Every week starts from scratch instead of getting smarter.

The hypothesis: with an LLM and a CRM, this loop can become a system that learns — where engagement automatically shapes what gets written next.

My approach

The judgment drives the automation — not the other way around

The hard part of marketing isn't sending email; it's knowing who to say what to. So the one thing the AI never decides is the segmentation. I define each audience and its angle; the engine executes that judgment at scale. To prove it isn't hard-coded to one case, the same engine runs two very different companies — and it segments them differently, because the right logic depends on the market:

Zip — enterprise procurement

Segments by · organizational role

A large company has many distinct stakeholders.

  • Procurement Leader (champion)
  • Finance Leader (economic buyer)
  • Business Requester (end user)

Shopify — SMB commerce

Segments by · business stage

One owner wears every hat — so maturity matters more than title.

  • First-time Founder
  • Growing DTC Brand
  • Established Retailer

Three engineering decisions, each with a marketing reason: the whole pipeline runs with no API keys (anyone can run it in one command, yet the real Claude + HubSpot integrations are in the code); engagement is simulated over a full segment audience the way a real email tool reports it; and adding a company is a single-file change — which is what makes it a reusable system, not a one-off.

Proof it's reusable

Same engine, two very different outputs

One engine, two very different companies Swap the company profile and the same pipeline changes who it targets, what it says — even how it segments. Zip Enterprise procurement software SEGMENTS BY ORGANIZATIONAL ROLE enterprises have many distinct stakeholders THREE AUDIENCES Procurement Leader (CPO / VP) Finance Leader (CFO / Finance Ops) Business Requester (any employee) TOP SEGMENT THIS RUN Finance Leader 16.4% click rate — led on "see spend before approval" Shopify Commerce platform for small-business owners SEGMENTS BY BUSINESS STAGE one owner wears every hat — role doesn't split THREE AUDIENCES First-time Founder (just starting) Growing DTC Brand (scaling up) Established Retailer (online + store) TOP SEGMENT THIS RUN Growing DTC Brand 20.4% click rate — led on "build a repeatable growth engine" Same code. One company-profile file in → different audiences, content, and insights out.

Swap one company-profile file and the pipeline changes who it targets, what it says, how it segments — and which audience wins. Nothing else in the code changes.

Real output

What one run actually produces

These aren't mockups — the pipeline generates a self-contained report on every run. Below are the real reports for each company, side by side. Same template; entirely different audiences, content, and insights.

Run report — Zip top segment: Finance Leader · 16.4% click
Campaign: “How to scale procurement without scaling headcount” · mock data (no API keys) · engagement simulated
Stage 1 · Generate
One topic in → a blog + three tailored newsletters
BLOGHow to scale procurement without scaling headcount
6-point outline · 181-word draft · saved as JSON + Markdown
“Every growing company hits the same wall. Headcount climbs, purchasing requests multiply, and procurement quietly becomes the team…”
Procurement Leader (CPO / VP)
Scale procurement without scaling your team
Stop being the bottleneck.
Hi {first_name},…
→ Read the post
Finance Leader (CFO / Finance Ops)
See every dollar before it's committed
Control without slowing the business.
Hi {first_name},…
→ Read the post
Business Requester (any employee)
Buy what you need, without the back-and-forth
One front door for every request.
Hi {first_name},…
→ Read the post
Stage 2 · Distribute
The right version to the right people
Procurement Leader (CPO / VP)280 in segment“Scale procurement without scaling your team”✓ SENT
Finance Leader (CFO / Finance Ops)220 in segment“See every dollar before it's committed”✓ SENT
Business Requester (any employee)900 in segment“Buy what you need, without the back-and-forth”✓ SENT
✓ Campaign logged · Real HubSpot v3 calls: Contacts · Lists · Single-send Email · Campaign object
Stage 3 · Measure
Segment performance
PersonaAudienceOpenClickUnsub
Procurement Leader (CPO / VP)28048.7%14.3%0.37%
Finance Leader (CFO / Finance Ops) TOP22046.7%16.4%0.93%
Business Requester (any employee)90039.1%7.3%0.68%
✦ AI performance summary

The 'finance_leader' segment led on engagement with a 16.4% click rate — about 9.1 points higher than 'requester'. Open rates were healthy across segments, so the gap is driven by message-to-offer fit rather than subject lines.

Recommendations
→ Double down on the angle that worked for 'finance_leader' — lead with the concrete ROI/time-saved hook in future sends.
→ Rework the 'requester' variant: swap the abstract framing for a specific, visual case study or before/after example.
→ Add a single, unmissable primary CTA per email to lift click-through.
Stage 4 · Optimize
What to publish next
  • → From cost center to strategic partner: redefining the procurement mandate
  • → The intake front door: why request experience drives policy adoption
  • → AI agents in procurement: where to start and what to automate first
  • → Measuring cycle time: the metric that proves procurement is scaling
A/B HEADLINE OPTIONS
Scale Procurement Without Scaling HeadcountThe Self-Service Procurement Playbook for High-Growth TeamsStop Being the Bottleneck: Orchestration Over Tickets
Why: Finance Leader (CFO / Finance Ops) drove the strongest click-through (16.4%), so the next slate leans into the angle that resonated with that segment.
↻ These suggestions feed back into Stage 1 as the next run's input — the loop that makes each round sharper.
Run report — Shopify top segment: Growing DTC Brand · 20.4% click
Campaign: “What separates stores that scale from stores that stall” · mock data (no API keys) · engagement simulated
Stage 1 · Generate
One topic in → a blog + three tailored newsletters
BLOGWhat separates stores that scale from stores that stall
6-point outline · 194-word draft · saved as JSON + Markdown
“Most advice for online stores assumes everyone has the same problem. They don't. What grows a brand-new store is almost the opposi…”
First-time Founder (just starting)
Your first sale is closer than you think
Start simple. Ship today.
Hi {first_name},…
→ Read the post
Growing DTC Brand Owner (scaling up)
From steady sales to a real growth engine
Turn buyers into repeat buyers.
Hi {first_name},…
→ Read the post
Established Retailer (online + in person)
One back office for your store and your website
Stop running two businesses.
Hi {first_name},…
→ Read the post
Stage 2 · Distribute
The right version to the right people
First-time Founder (just starting)1200 in segment“Your first sale is closer than you think”✓ SENT
Growing DTC Brand Owner (scaling up)600 in segment“From steady sales to a real growth engine”✓ SENT
Established Retailer (online + in person)300 in segment“One back office for your store and your website”✓ SENT
✓ Campaign logged · Real HubSpot v3 calls: Contacts · Lists · Single-send Email · Campaign object
Stage 3 · Measure
Segment performance
PersonaAudienceOpenClickUnsub
First-time Founder (just starting)120043.7%10.2%0.86%
Growing DTC Brand Owner (scaling up) TOP60049.9%20.4%0.69%
Established Retailer (online + in person)30042.2%9.2%0.34%
✦ AI performance summary

The 'growing_brand' segment led on engagement with a 20.4% click rate — about 11.2 points higher than 'omnichannel_retailer'. Open rates were healthy across segments, so the gap is driven by message-to-offer fit rather than subject lines.

Recommendations
→ Double down on the angle that worked for 'growing_brand' — lead with the concrete ROI/time-saved hook in future sends.
→ Rework the 'omnichannel_retailer' variant: swap the abstract framing for a specific, visual case study or before/after example.
→ Add a single, unmissable primary CTA per email to lift click-through.
Stage 4 · Optimize
What to publish next
  • → The first-100-orders playbook: launching without tool overload
  • → Email flows that turn one-time buyers into repeat customers
  • → Knowing your numbers: the 4 metrics every growing store should watch
  • → Going omnichannel without doubling your workload
A/B HEADLINE OPTIONS
What Separates Stores That Scale From Stores That StallSystems Beat Hustle: Growth Advice for Every StageThe Repeat-Customer Engine Most Stores Never Build
Why: Growing DTC Brand Owner (scaling up) drove the strongest click-through (20.4%), so the next slate leans into the angle that resonated with that segment.
↻ These suggestions feed back into Stage 1 as the next run's input — the loop that makes each round sharper.
Architecture & stack

How it's built

AI-Powered Content Pipeline A performance-driven content engine — the loop gets sharper every time it runs TOPIC e.g. "scaling procurement" 1 GENERATE Blog + 3 persona newsletters Claude · stored as JSON / Markdown Procurement Finance Requester 2 DISTRIBUTE Tag · segment · send · log HubSpot CRM Right variant → right segment Campaign logged for reporting 3 MEASURE Engagement per persona Open / click / unsub (simulated) Stored in SQLite for history AI performance summary 4 OPTIMIZE Next topics + A/B headlines Reads the engagement trend engagement feeds the next run Runs end-to-end with no API keys (mock mode) · real Claude + HubSpot integrations when keys are provided · engagement is simulated for demonstration
PythonAnthropic Claude (content + summaries) HubSpot v3 CRM + Marketing APIsSQLite (engagement history) Flask dashboardCompany-profile architecture