Newsletter signup notification
You want a “subscribe” form on your site, but you don’t want to build a list manager — that’s Listmonk territory. The pragmatic shape: a form that takes an email address, validates it, and notifies you by email so you can manually add the subscriber to whichever platform you actually use (Listmonk, Buttondown, Beehiiv, Substack).
At the end: a /subscribe form that emails you whenever someone signs up. Subscriber gets a “thanks, you’ll hear from us” redirect. You decide what to do with the address.
Prerequisites
Section titled “Prerequisites”Same as Contact form — a verified Postmark sender domain, a server token, a Docker host, a reverse proxy.
Walkthrough
Section titled “Walkthrough”-
Add an endpoint to
posthorn.toml.If you’ve already got the contact form recipe running, just add a second
[[endpoints]]block to the existing config:[[endpoints]]path = "/api/subscribe"to = ["you@yourdomain.com"]from = "Newsletter Signups <noreply@yourdomain.com>"honeypot = "_gotcha"allowed_origins = ["https://yourdomain.com", "https://www.yourdomain.com"]required = ["email"]subject = "New subscriber: {{.email}}"body = """New newsletter signup.Email: {{.email}}"""redirect_success = "/subscribed/"[endpoints.transport]type = "postmark"[endpoints.transport.settings]api_key = "${env.POSTMARK_API_KEY}"[endpoints.rate_limit]count = 3interval = "1m"Note the tighter rate limit (
count = 3) — a single visitor signing up multiple times is suspicious; 3-per-minute catches both real double-tap-submit accidents and basic abuse. -
Restart the container.
Terminal window docker compose restart posthornOr, if it’s the first endpoint:
Terminal window docker compose up -d -
Wire
/api/subscribethrough your reverse proxy (same pattern as the contact form — adjust the path). -
Add the form to your site.
<form method="POST" action="/api/subscribe"><label>Email<input name="email" type="email" required placeholder="you@example.com"></label><!-- Honeypot --><input type="text" name="_gotcha" tabindex="-1" autocomplete="off"style="position:absolute;left:-9999px" aria-hidden="true"><button type="submit">Subscribe</button></form> -
Add a
/subscribed/page.The post-submit redirect needs to land somewhere. Keep it honest:
<h1>Thanks for subscribing</h1><p>You'll hear from us when there's news worth sharing.</p>Don’t claim “check your inbox to confirm” — there is no confirmation email in this shape. If you want one, pair with a real list manager (see the note at the top).
Tracking signups outside Posthorn
Section titled “Tracking signups outside Posthorn”The notification email is the trigger; what happens next depends on your platform. A couple of patterns:
- Manual: read the notification email; add the address to your list manager. Fine at small scale (< 1 signup per day).
- Filter + forward: in Postmark’s inbound (or your own MUA), filter
From: "Newsletter Signups"and forward to a service. Listmonk and Buttondown both have email-in import options. - Webhook fan-out (v2): when Posthorn v2 ships, the same submission will fan out to email and to a webhook (e.g.,
POSTthe JSON-encoded form to your list manager’s subscribe API). Single-step subscribe-and-record.
Common gotchas
Section titled “Common gotchas”| Symptom | Likely cause | Fix |
|---|---|---|
| Same email subscribes 10 times in an hour | Posthorn doesn’t dedupe by email content | Dedupe at your list-manager step, or move the signup to an api-mode endpoint and pass a stable Idempotency-Key |
| Subscriber expects a confirmation email | This recipe doesn’t send one | Update your “Thanks” page copy to set expectations; or pair with Listmonk for real double opt-in |
| Bots are signing up garbage addresses despite the honeypot | Bots that bypass the honeypot are usually fillable-form scanners that succeed with any non-empty value | Add a server-side step that checks if the domain has MX records before forwarding (Posthorn does syntactic email validation only; deeper checks aren’t on the roadmap) |
Where to go next
Section titled “Where to go next”- Contact form — pairs naturally with subscribe
- Multi-form site — both forms in one Posthorn config
- Listmonk — the right tool if you need true list management on top of Posthorn