Skip to content

Case study / Senderly

Ready-to-send eCommerce email campaigns, generated from product and brand inputs

Senderly is an AI engine that turns eCommerce product and brand inputs into ready-to-send marketing emails, with on-brand copy and finished image creatives from one pipeline. I designed and built it end to end as a Flask REST service: GPT-4 writes structured copy, a second stage designs the layout, and Kie.ai renders the final PNGs through webhook-driven async jobs.

Client
Senderly
My role
Lead engineer — designed and built end to end
Sector
eCommerce & Marketing
Senderly — product screenshot 1 of 1

The challenge

An eCommerce marketing email needs two things that usually come from different people: copy that sounds like the brand, and a designed image that shows the right product. Traditional template editors leave both to the marketer. For a brand sending a steady stream of campaigns, that becomes a production line of briefs, drafts, design rounds and manual exports, and the brand voice tends to drift as volume goes up.

Generating the email with a language model looks like an easy fix, but free-form model output is hard to build on. A block of prose cannot be checked, laid out or rendered reliably. Image rendering is slow and can fail part-way through, so a simple request-and-wait API would time out or lose work. The system had to produce assets a marketer could send, not drafts they would have to rebuild.

  • Turn raw product and brand inputs into finished email assets, not just suggested text
  • Keep copy and visuals on-brand across bulk generation, not only one email at a time
  • Handle slow, failure-prone image rendering without blocking the API or losing jobs
  • Hand finished campaigns on to the brand’s email service provider (ESP)

What I built

I designed and built Senderly as a multi-stage REST pipeline in Flask, where each stage has one job and a defined output. Splitting the work this way means each step can be checked, retried and improved on its own, instead of relying on a single prompt to get everything right.

In the first stage, GPT-4 writes the email copy as structured Email Copy JSON rather than free text. A fixed structure means the output can be validated before anything else runs, and later stages always know where each piece of copy sits. The second stage takes that copy and produces Image JSON: a layout blueprint describing how the creative should be composed. Keeping what the email says separate from how it looks makes both easier to control.

Rendering runs through Kie.ai as webhook-driven async jobs. The API starts a render and returns straight away; when the render finishes, a webhook brings the result back and the final PNG creative is produced with the product assets inlined. SQLite tracks the state of every async job, along with retries and the handoff to ESPs, so a slow or failed render is picked up again instead of silently disappearing.

Marketers also needed control without editing prompts by hand, so I built prompt tooling that keeps output on-brand across bulk generation, not just one email at a time.

  • Flask REST API orchestrating a multi-stage AI pipeline
  • GPT-4 producing structured Email Copy JSON
  • A second stage generating Image JSON layout blueprints
  • Kie.ai rendering through webhook-driven async jobs, with product assets inlined in the final PNG
  • SQLite tracking job state, retries and handoff to ESPs
  • Prompt tooling to keep bulk output on-brand

Architecture and stack

AI
OpenAI GPT-4 · Kie.ai · Structured JSON outputs
Backend
Python · Flask · REST API
Jobs & data
Webhooks · Async jobs · SQLite

Outcome

Senderly takes an eCommerce brand from product and brand inputs to ready-to-send email campaigns, with finished copy and creatives coming out of one pipeline. The manual design round between writing and sending is replaced by a repeatable process that runs the same way for one email or a bulk batch.

Because every stage produces structured output and every render is tracked as a job, failures are visible and recoverable rather than lost, and finished campaigns hand off cleanly to the ESP. The prompt tooling keeps the brand voice consistent as volume grows, which is exactly where hand-written and loosely prompted email tends to drift.

The pattern carries over to most AI products I build or review: give the model a structured output, split generation into stages you can test, and treat slow external calls as tracked async jobs rather than hoping a single request succeeds.

Last updated 2026-10-03

Have a project like this?

Book a free 1-hour intro call, or send a short brief and I’ll reply with a proposed scope within two working days.