Resend email setup
Resend sends severity-routed alert emails (medium / high / critical) to any address you configure. Free tier gives you 3,000 emails a month — plenty for personal monitoring.
What you need
- A Resend account — free at resend.com.
- A domain you can add DNS records to (e.g.
yourdomain.com), OR Resend's onboarding sandbox if you just want to try it. - One Resend API key (created in the Resend dashboard).
11. Verify a sending domain
In the Resend dashboard, open Domains → Add Domain and follow the DNS instructions (SPF + DKIM TXT records). Resend usually verifies within a few minutes once DNS propagates.
onboarding@resend.dev without verifying a domain — useful for testing, but recipients may see a warning header.22. Create an API key
Open resend.com/api-keys → Create API Key. Give it Sending access (the most-restrictive option). Copy the key — it starts with re_ and is shown once.
33. Choose where the key lives
SafeOS Guardian supports two patterns. Pick whichever fits your deployment.
Server-wide key (operator pays)
Set these four values in your API server's .env file. The server sends alert email with this key only for the operator's own account (the profile with the operator role). For any other account, alert email needs a personal key saved in that profile's notification settings through the API (emailOverride); the settings page does not save one.
RESEND_API_KEY=re_xxxxxxxxxxxxxxxxxxxxxxxx EMAIL_FROM="SafeOS Guardian <alerts@yourdomain.com>" EMAIL_REPLY_TO="team@yourdomain.com" SAFEOS_API_PUBLIC_URL=https://safeos-api.yourdomain.com
SAFEOS_API_PUBLIC_URL is the https address of your API server. Every email's Unsubscribe link points there, so the server sends no email until it is set (behind the bundled Caddy, SAFEOS_DOMAIN is enough).
Restart your API server after editing. The setting takes effect immediately.
Your own key, for the test email
Go to Settings → Notifications, enable email alerts, and toggle Use my own Resend account. Paste your API key and a sender address from a domain you verified in your Resend account. The page sends the key to the API server with the test email and does not save it, so alerts do not use it.
44. Test the integration
- Open Settings → Notifications.
- Toggle Enable email alerts.
- Enter the address you want alerts sent to.
- Click Send test email. You should get a confirmation message and receive the email within a few seconds.
The Unsubscribe link in every email
- Every email the API server sends (alerts, the test message, account verification and password reset) ends with an Unsubscribe link and carries the
List-UnsubscribeandList-Unsubscribe-Postheaders, so mail apps can show their own unsubscribe button (RFC 8058). - Opening the link shows a page that asks and changes nothing. Its button, or a mail app's one-click unsubscribe, stops the email at once. No email is sent to confirm it.
- Alert email and test messages stop for that address. Account email is sent only when someone asks for it; its link turns off every optional email and says what still comes.
- To stop all email to an address, account email included, run
docker compose exec -T api npx tsx src/cli/mail-suppress.ts < addresses.txt(one address per line). When a person who unsubscribed asks for email again, the same command with--resubscribelifts their unsubscribe; a manual stop stays. - Mail apps act on the one-click header only when your domain's DKIM signature covers both headers. Open a received email's original source and check that the
h=list of itsDKIM-Signatureincludeslist-unsubscribeandlist-unsubscribe-post.
Which alerts go to email?
SafeOS Guardian routes alerts by severity. The default policy:
| Severity | Browser push | SMS | Telegram | |
|---|---|---|---|---|
| info | ✓ | — | — | — |
| low | ✓ | — | — | — |
| medium | ✓ | ✓ | — | ✓ |
| high | ✓ | ✓ | ✓ | ✓ |
| critical | ✓ | ✓ | ✓ | ✓ |
Quiet hours skip delivery of low and medium alerts. High and critical alerts bypass quiet hours.
Where your data lives
- A Resend API key you type on the settings page is sent with the test email and is not saved in this browser. Alerts are sent with the key set on the server.
- Email content is rendered server-side and POSTed to Resend over HTTPS. SafeOS keeps no copy of the email body after dispatch.
- The recipient address is stored on your profile (and locally). Change or clear it at any time from the settings page.
- For the Unsubscribe link, the server keeps the SHA-256 of the recipient address and of the link's token, never the address itself.
- Frame does not receive copies of your alert emails. The path is
your browser → your SafeOS API server → Resend → your inbox.
Troubleshooting
- The test email button is disabled.
- Check that (a) the toggle is on, (b) the recipient field is a valid email, and (c) either the server reports Resend as configured (badge on this page) or you've entered your own API key.
- The test says "Email not configured" although my key is set.
- Every email carries an Unsubscribe link back to your API server, so the server needs its own https address. Set
SAFEOS_API_PUBLIC_URL(orSAFEOS_DOMAINbehind the bundled Caddy) and restart the server. - The test says the address unsubscribed.
- Someone used the Unsubscribe link in an email to that address, so SafeOS Guardian sends it no more alert or test email. If it was you, ask whoever runs the server to run the
mail-suppresscommand with--resubscribefor your address, or use another address. - I get "Resend send failed: From address not authorized".
- Your
Fromaddress must use a domain that's verified in your Resend account. Either verify the domain or fall back toonboarding@resend.dev. - I'm not receiving alert emails even though the test worked.
- The test uses the key you typed; alerts do not. Alert email is sent for the operator's account with the server's key, or with a personal key saved through the API. Then confirm the alert severity is at least medium — info and low events never go to email by default. Also check spam, and the rate limits in your Resend dashboard.
- I want different sender names per scenario.
- Not currently supported — every alert uses the same
EMAIL_FROM(server) or sender override (BYO). Open an issue if you need per-stream sender routing. - Where do I see Resend errors?
- Server logs print
[NotificationManager]andResend send failed: …lines. The Resend dashboard's Logs tab shows every send attempt with delivery state.