August 24, 2026·3 min read

Building a Blog Subscriber System with Resend

#nextjs#resend#email

Most static blogs skip email entirely — no subscribe box, no notifications. That's fine until you actually want people to come back. Here's the system I'm using for this blog: collect emails, store them somewhere durable, and send a notification the moment a new post ships.

The pieces

There are three parts to this:

  1. A subscribe form on the blog that captures an email
  2. A place to store subscriber emails (a database — Postgres works well)
  3. A trigger that fires when a new post is published, which sends an email via Resend to every subscriber

Resend handles the actual sending. It's built for developers — you call an API with a sender, a recipient, and either HTML or a React email template, and it handles deliverability, bounces, and unsubscribes.

Setting up Resend

After creating a Resend account and verifying a sending domain (in this case, shoudo.xyz, so emails come from noreply@shoudo.xyz), the setup is mostly two things: an API key, and a verified domain with the right DNS records (SPF, DKIM) added.

Once the domain is verified, sending an email is a single POST request to Resend's /emails endpoint, with the sender address, recipient address, subject line, and HTML body included in the request payload.

Storing subscribers

The subscribe form itself is simple — an email input and a submit button that posts to an API route. That route validates the email and inserts it into a subscribers table. Duplicate emails are ignored rather than erroring, so someone resubmitting the form doesn't break anything.

A minimal schema is just an email column, a subscribed-at timestamp, and an unsubscribe token — the token matters more than it seems, because every marketing email needs a working one-click unsubscribe link to stay compliant and to avoid getting flagged as spam.

Notifying on publish

Since posts here are Markdown files that get committed and pushed to GitHub, the natural trigger is the deploy itself. A GitHub Action (or a Vercel deploy hook) can detect when a new post file lands in the posts folder, and call a small API route that:

  • reads the new post's title, excerpt, and slug
  • pulls the full subscriber list from the database
  • sends a batch of emails through Resend, each with an unsubscribe link

Resend supports batch sending, so this doesn't mean looping through subscribers one email at a time — it can go out as a single batched request.

What's next

This post describes the plan more than a finished implementation — the actual subscribe form, the database, and the publish hook are the next things to wire up on this blog. Once they're live, this post will get updated to reflect the real setup instead of the plan for it.