runbookify
← All plans
Marketing Operations / Email List & Newsletter Ops

Subscriber Segment Builder

Let marketers build counted, named, exportable email segments from rules like source, tags, engagement, and last purchase - no SQL, no waiting on an analyst.

IntermediateA weekendBuilds onNext.js (App Router) on VercelSupabase (Postgres, Auth, RLS, Storage)Resend (notifications)
What you'll build

A login-protected app where you point-and-click audience rules, see a live count and sample, approve and name the segment, and export a clean recipient CSV for your ESP.

Gated download

Enter your email — the plan downloads instantly and a copy lands in your inbox.

By submitting your email you'll also receive the weekly runbookify newsletter. You can unsubscribe at any time.

Before you start

  • A subscriber export (CSV) with attributes like tags, source, engagement, location, last purchase
  • Free Vercel, Supabase, and Resend accounts
  • Claude Code installed on a Linux machine

The problem this kills

You want to send to "people who joined from the webinar, opened something in the last 60 days, and live in the EU" - and you're stuck. Either you wrangle a giant spreadsheet with nested filters that breaks every time, or you file a ticket with the one analyst who can write SQL and wait three days for a list that's already stale. Every send turns into a negotiation. So you blast the whole list instead, your engagement drops, and your unsubscribes climb.

The cost isn't just time. Untargeted sends hurt your sender reputation, bury your good content, and train subscribers to ignore you. You know who you want to reach. You just can't slice your own list.

What you'll build

A simple web app - just for your team - that turns audience rules into real, exportable segments:

  • Import your subscribers from a CSV with all their attributes (tags, source, engagement, location, last purchase) - or wire it to your data source later.
  • Build rules by clicking, not by writing code: "source IS webhook AND last_open within 60 days AND country IN (DE, FR, ...)" with AND/OR rule groups.
  • See it before you commit: a live estimated reach (the count) and a sample of who's in it - updated as you tweak rules.
  • A human approval gate: you review the definition, the count, and the sample, then approve and name the segment before anything is saved.
  • Reusable named segments you can re-run, and a one-click recipient CSV export in the exact columns your email tool expects.

What's inside the Implementation Plan

The plan is a single file you paste into Claude Code (an AI coding agent). It builds the whole thing with you, step by step.

It opens by interviewing you about your business - your list, your attribute names, how you define "engaged," your typical send sizes - so the tool fits your data instead of a generic template. You confirm a short spec, then it builds: the database, the import, the rule builder UI, the live count, the approval-and-name gate, the saved-segment library, and the ESP export. Every step ends with a copy-paste prompt.

The governance it includes (this is the point)

This isn't a throwaway script. The plan bakes in the controls that make a tool safe to keep:

  • Login so only your team can use it.
  • Row-level security so each organization only ever sees its own subscribers and segments.
  • A full audit trail - who built, approved, named, and exported each segment, and when.
  • A human-in-the-loop approval gate - a segment isn't saved as reusable until a person reviews the count and sample and approves it.
  • Duplicate guards - a segment-name + rule-hash key so the same segment can't be saved twice by accident.

Who it's for

Email and lifecycle marketers who can't slice their own list and have to wait on someone else for every send. If you can describe the audience you want in plain English, this gives you the tool to build it yourself.

You've got this - paste the first prompt and let the agent interview you.

Gated download

Enter your email — the plan downloads instantly and a copy lands in your inbox.

By submitting your email you'll also receive the weekly runbookify newsletter. You can unsubscribe at any time.