Why Resend?
Resend is the recommended ESP for PubOps. It has a clean API, good deliverability, and the webhook model fits our audience metrics collection.
Get the credentials
- Sign up at resend.com.
- Go to API Keys → Create API Key. Copy the key (starts with
re_). It only shows once. - Optionally go to Contacts → Segments and copy a Segment ID if contact synchronization should be limited to one segment. PubOps sends to its exact eligible-recipient set rather than a provider-wide broadcast.
- Go to Domains → add and verify your sending domain (e.g.
newsletter.yourdomain.com). You'll need to add the DNS records Resend shows you. - Go to Webhooks → add a webhook endpoint. The URL is
https://yourdomain.com/api/webhooks/resend. Subscribe to:email.opened,email.clicked,email.bounced,email.complained. Copy the signing secret (Svix format).
Configure the env vars
In your .env.local (dev) or hosting platform's secrets (prod):
RESEND_API_KEY=re_xxxxxxxxxxxx # Optional: limit contact sync to one Resend segment RESEND_SEGMENT_ID=xxxxxxxx-xxxx-xxxx EMAIL_FROM="PubOps <hello@yourdomain.com>" RESEND_WEBHOOK_SECRET=whsec_xxxxxxxx
Verify
Re-run the setup wizard's connection test, then preview contact synchronization. A live publish should record Resend message IDs for the exact PubOps recipients. A 401 means the key was revoked; a 403 means it lacks access; a 404 on sync usually means the optional segment was deleted.
Webhook troubleshooting
If the audience chart in the post-mortem never updates: check that your webhook endpoint is reachable. From a terminal:
curl -X POST https://yourdomain.com/api/webhooks/resend \
-H "svix-signature: ..." \
-d '{"type":"email.opened","data":{"email_id":"..."}}'You should get { ok: true } back.