Newsletter engine

An email sending platform on Amazon SES with queues, tracking, bounces and automations, and no per-contact fees.

Stack
Node.js, PostgreSQL, Amazon SES
Area
Marketing
The newsletter dashboard with subscribers, sends and bounce rates

Where we started

Services like MailerLite or Mailchimp work well, but your contacts stay with them, separate from your clients, orders and deals. Any question that brings the two worlds together, such as “has this customer who bought from us ever opened one of our emails?”, needs an export, a manual cross-check and an answer that’s a week old. On top of that, the cost grows with the number of contacts.

The business platform already held everything else: clients, leads, orders. Bringing the newsletter in too meant answering those questions with a simple database query.

What we did

We wrote a newsletter module that sends on its own through Amazon SES, Amazon’s email sending service, and used it to replace MailerLite in the business platform. The original system works with around 12,000 contacts.

From there we extracted the engine, the part that decides whether a sending system holds up, and stripped out everything tied to a single project. It’s a reusable kit: it connects to a PostgreSQL database and a Node.js server, and everyone builds their own interface on top.

The real cost of sending in-house isn’t money but sender reputation. A platform manages it for you; doing it yourself makes it your responsibility, and one bad campaign can burn it. That’s why the code is commented line by line: it explains why each thing is written this way and not in the most obvious way, which is usually the one that breaks after the first real campaign.

Three safeguards are mandatory before sending: verifying the signature on bounce notifications, because otherwise anyone could get your list deleted; an unsubscribe link on the sender’s domain with the headers Gmail and Yahoo have required since 2024; and leaving Amazon’s sandbox mode, which takes about 24 hours.

How it’s built

  • Sending queues in small batches, with scheduled campaigns and segments
  • Email HTML built from blocks
  • Open and click tracking on your own server
  • One-click unsubscribe and double opt-in
  • Bounces and complaints received through Amazon SNS, with automatic removal
  • Step-by-step automations, driven by a clock that runs every minute
  • Commented PostgreSQL schema and a technical guide to DNS, SPF, DKIM and DMARC

Outcome

The business platform’s newsletter module replaced MailerLite, and contacts sit in the same database as clients and orders. The cost stays at the Amazon SES rate: $0.10 per thousand emails, about $5 for 48,000 emails a month. The kit is ready to be reused in other projects.

Want something similar? Let’s talkAll work