Skip to content
Tinbox

tutorials

A self-hosted newsletter tool with no per-contact tax

November 2, 2026

#newsletter#self-hosted#broadcasts#segments#deliverability
One newsletter connected to three distinct audience groups.

The per-contact tax punishes you for exactly the growth you wanted. Your list doubles, your campaign volume stays flat, and the bill goes up anyway. A list you own does not work that way.

This is a walkthrough of running a real newsletter on infrastructure you control: sending broadcasts, segmenting your audience, tracking opens and clicks, and honoring unsubscribes, all on the same contact list as your transactional mail. It assumes your list is already in your own database. If you are still on Mailchimp and need to get your subscribers out with tags and status intact first, start with migrate your existing list in first, then come back here to operate it day to day.

What is the per-contact tax, and why does it punish growth?

The per-contact tax is the pricing model where a newsletter vendor charges you by the size of your audience, not by what you send. Add 5,000 subscribers and your monthly tier jumps, even if you send the same one campaign a week to all of them. The cost is decoupled from the work: you pay for the size of a list the vendor is merely storing.

The arithmetic gets worse as you win. A 50,000-contact list on a mainstream newsletter SaaS runs into the hundreds of dollars a month before you send anything unusual, and the marginal contact keeps costing more. For the full worked numbers across providers, see the per-contact tax, in worked numbers. The short version: you are renting a row in someone else's database at a price that scales with your success.

A self-hosted newsletter tool inverts this. Subscribers are rows in your own database (Cloudflare D1 in this stack). Storing 50,000 contacts is a handful of megabytes. The cost of sending is per-message compute, which is effectively flat for a normal newsletter cadence. List size and bill size are decoupled. If you are still choosing a destination, the roundup of tools to own your newsletter on your own domain and the flat-rate newsletter platform alternatives survey the options that escape the per-contact tax.

How does one contact list power both transactional and marketing mail?

The same contacts power your receipts, password resets, and your weekly broadcast, with one record per person in one database. There is no second vendor and no export step between "transactional" and "marketing," because they were never separate systems.

A contact is a single row. Consent for marketing is a flag on that row, separate from the fact that you can send the person a transactional receipt:

-- One contact, one record. Marketing consent is a column, not a second vendor.
CREATE TABLE contacts (
  id            TEXT PRIMARY KEY,
  email         TEXT NOT NULL UNIQUE,
  name          TEXT,
  marketing_ok  INTEGER NOT NULL DEFAULT 0,  -- consented to broadcasts
  status        TEXT NOT NULL DEFAULT 'active', -- active | unsubscribed | bounced
  tags          TEXT,                          -- JSON array, e.g. ["beta","paid"]
  created_at    INTEGER NOT NULL
);

Because this is your table, a broadcast audience and a transactional recipient are the same kind of object. You do not reconcile two lists or pay two bills for the same human. That single-list model is the heart of the the newsletter tool in the full stack: transactional sender, broadcasts, and inbox all read the same contacts.

How do I send a broadcast?

You compose the campaign, choose who receives it, and send it through a queue-backed pipeline that fans the send out across many small jobs instead of one long request. Sending to a real list from a single synchronous request will hit CPU and rate limits; the queue is what makes a 50,000-recipient send survivable.

From the CLI:

tinbox broadcast send \
  --subject "June product update" \
  --html ./campaigns/june-update.html \
  --audience all

A trimmed log of the queue-backed send:

[broadcast] campaign cmp_2f9a created
[broadcast] audience "all": 48,210 contacts (suppressed 612 excluded)
[broadcast] enqueued 48,210 messages across 97 batches
[queue]     batch 1/97  sent 500  failed 0
[queue]     batch 2/97  sent 500  failed 0
...
[queue]     batch 97/97 sent 210  failed 3   (3 soft-bounce, will retry)
[broadcast] done: 47,595 delivered, 612 suppressed, 3 deferred

Note the line suppressed 612 excluded. The suppression list is applied before a single message is enqueued, so opted-out addresses never enter the pipeline. We will come back to that.

How do I define a segment?

A segment is a query over your own contacts. Because the audience lives in your database, you are not picking from a vendor's pre-baked filter UI: you write the condition you actually want and send to exactly that set.

Target subscribers who carry the paid tag and consented to marketing:

// Define a segment as a query, preview the count, then send to it.
const segment = await tinbox.contacts.query({
  where: {
    marketing_ok: true,
    status: "active",
    tags: { contains: "paid" },
  },
});

console.log(`${segment.count} contacts match`); // 3,114 contacts match

await tinbox.broadcasts.send({
  subject: "Early access for paid members",
  html: paidUpdateHtml,
  audience: segment, // sends to exactly these rows
});

The same shape works for engagement-based segments ("opened the last campaign," "clicked in the last 30 days") because open and click events are stored in your tables too. There is no per-segment fee, because there is no SaaS metering your audience. For more patterns in this style, the ways plain SQL beats a drag-and-drop segment builder walks through queries you cannot express in a vendor's filter UI.

How do unsubscribes and compliance work?

Unsubscribe handling is mandatory and enforced at send time, not left to your memory. Every broadcast carries a one-click unsubscribe link and the RFC 8058 List-Unsubscribe and List-Unsubscribe-Post headers, so Gmail and Yahoo can show a native unsubscribe button. When someone opts out, their address goes on a suppression list, and the sender refuses to include suppressed addresses in any future broadcast.

A suppression record is concrete and queryable. This is what an opt-out looks like in your own database:

suppressions
------------
email           reason        source        created_at
jo@example.com  unsubscribe   campaign:cmp_2f9a   2026-07-14T09:02:11Z
ali@example.net complaint      fbl:gmail          2026-07-14T11:40:55Z

Honoring opt-out is both the law (CAN-SPAM in the US, GDPR consent rules in the EU) and a deliverability rule: mailbox providers treat continued sending to people who unsubscribed as a strong spam signal. The suppression list exists so that the rule is impossible to forget, because the sender simply will not mail those rows.

The send is blocked or warned before anything goes out. This is the failure-then-fix that matters most for a newsletter, so it is worth seeing the guardrail trip.

A broadcast with no unsubscribe link in the HTML:

tinbox broadcast send --subject "Sale" --html ./sale.html --audience all
[broadcast] ERROR: refused to send
  - campaign HTML has no unsubscribe link and no {{unsubscribe_url}} token
  - marketing broadcasts must include a working unsubscribe link (RFC 8058)
  fix: add {{unsubscribe_url}} to your template, or pass --footer to inject the default

The fix is to include the merge token the sender will replace per-recipient with a unique, signed unsubscribe URL:

<!-- Add this to the campaign footer; the sender fills it per recipient. -->
<p style="font-size:12px;color:#888">
  You are receiving this because you subscribed at example.com.
  <a href="{{unsubscribe_url}}">Unsubscribe</a>.
</p>

Re-run, and the send proceeds, with suppressed addresses excluded automatically (the suppressed 612 excluded line from earlier). Trying to manually re-add an unsubscribed contact to an audience is also rejected: the suppression list wins over any audience you hand it.

What about list hygiene and deliverability before a broadcast?

Do not blast. A list you own does not protect you from a cold list or an unwarmed domain; it just means the reputation you build (or burn) is yours. Three rules carry most of the weight:

  1. Authenticate the domain first. SPF, DKIM, and DMARC must pass or large sends will land in spam. See authenticate your domain before broadcasting.
  2. Warm up. A domain with no sending history that suddenly emits 50,000 messages looks exactly like a spammer. Ramp volume over days.
  3. Prune. Remove hard bounces and complaints promptly; they are already on the suppression list, but watch the rate.

The owned tradeoff is honest: you control reputation, so you also own it. Nothing here promises inbox placement. For the full pre-broadcast checklist, see list hygiene and warmup before you broadcast.

How do I track opens and clicks?

Open and click events are stored as rows in your database, so reporting is a query you run, not a dashboard a vendor rents you. The send pipeline records a delivery, an open (via a first-party tracking pixel on your own domain), and a click (via first-party link wrapping), all keyed to the campaign and the contact.

-- Engagement for one campaign, straight from your own tables.
SELECT
  COUNT(*)                                          AS delivered,
  SUM(CASE WHEN opened_at  IS NOT NULL THEN 1 END)  AS opens,
  SUM(CASE WHEN clicked_at IS NOT NULL THEN 1 END)  AS clicks
FROM broadcast_events
WHERE campaign_id = 'cmp_2f9a';

Because the tracking is first-party (your domain, your tables), it does not leak reader behavior to a third party, and you can build any report you want on top of it: per-link clicks, engaged segments for the next send, or a cohort over time.

Where does Mailchimp still win?

Mailchimp's drag-and-drop email builder, deep template marketplace, and visual automation journeys are genuinely more polished, and for a non-technical marketing team they are the easier surface. If your campaigns are designed by someone who will never touch HTML or a CLI, that builder is real value, and this self-hosted approach asks more of you up front.

What a self-hosted tool gives back is ownership and flat cost: broadcasts, segments, open/click tracking, and enforced unsubscribe handling, on a contact list that is yours, with no per-contact tax and no export-to-leave. It does not match Mailchimp's visual journey builder today, and pretending otherwise would be dishonest. The trade is a more code-shaped workflow in exchange for owning your audience and never paying more just because your list grew.

If that trade is the one you want, you can stand the whole thing up in one command.

Deploy this yourself: npx tinbox init <domain>. The broadcast sender, segments, suppression list, and tracking come wired into the same Worker and D1 database as your transactional mail; the docs cover the CLI and library calls used above.

Frequently asked questions

Is there per-contact pricing with a self-hosted newsletter tool?

No. Subscribers are rows in your own database, so the cost of a larger list is a few more megabytes of storage, not a higher monthly tier. SaaS newsletter tools bill by audience size, which means your bill grows every time your list does, even if you send the same number of campaigns. Self-hosting moves the cost to storage and per-send compute, both effectively flat for a normal newsletter, with no per-subscriber line item.

How do unsubscribes work in a self-hosted newsletter tool?

Every broadcast includes a one-click unsubscribe link and the RFC 8058 List-Unsubscribe headers. When someone unsubscribes, their address is written to a suppression list, and the sender refuses to include suppressed addresses in any future broadcast. Honoring opt-out is both a legal requirement (CAN-SPAM, GDPR) and a deliverability requirement, so it is enforced at send time, not left to you to remember.

Can I segment my list in a self-hosted newsletter tool?

Yes. Because contacts live in your own database, a segment is just a query over your contact table: subscribers who opened the last campaign, who signed up after a date, who carry a given tag, or any combination. You define the segment, preview the count, and send the broadcast to exactly that set. There is no per-segment fee because there is no SaaS in the middle.

Does the newsletter share a contact list with transactional email?

Yes, that is the point. The same contacts power password resets, receipts, and your weekly broadcast, with one record per person in one database. You do not export a list from one vendor and import it into another, and you do not pay two vendors for the same human. Marketing consent and transactional sending are tracked on the same row.

Where does Mailchimp still beat a self-hosted newsletter tool?

Mailchimp's drag-and-drop email builder, large template marketplace, and visual automation journeys are more polished and friendlier for non-technical teams. A self-hosted tool gives you broadcasts, segments, tracking, and unsubscribe handling on a list you own; it does not (yet) match Mailchimp's visual journey builder. If a non-technical marketer needs to design campaigns with no code, Mailchimp is the easier surface.