0007 Send the daily email with Resend¶
- Status: Accepted
- Date: 2026-12-04
Context¶
Milestone 1 ends with a daily email of the picks to one person, the project's maintainer. Milestone 2 adds more users, each with their own email.
The email is sent from the daily GitHub Actions workflow:
- The code uses Python's standard library where it can, so the email service should work with a plain HTTP request.
- The repository is public, so its logs and run summaries are public. The API key and the email address must stay in GitHub Secrets, and nothing may print them.
- Job details may go to the person who gets the email, but never anywhere public (Job sources).
Options considered¶
| Option | For | Against |
|---|---|---|
| Resend | Simple JSON HTTP API. Supports idempotency keys, so a retry can't send twice. Sends to any address once a domain is verified, which Milestone 2 needs. Works with a test sender before any domain is set up. | A third-party service that sees each email's content and address |
| Postmark | Known for good delivery | No advantage for this project's needs, and it needs a verified sender before sending anything |
| Gmail over SMTP with an app password | No new account | Ties sending to a personal mailbox and its limits. Doesn't fit sending to other users later. |
Decision¶
Send the daily email with Resend's HTTP API.
- Sender for now: Resend's test sender,
onboarding@resend.dev. Resend only lets it send to the email address of the Resend account itself, soWFHEAVEN_TO_EMAILmust be that address. That's enough for Milestone 1. - Later: verify a domain in Resend and set
WFHEAVEN_FROM_EMAILto an address on it. This is needed before sending to anyone else, so it's part of Milestone 2. Real users also need an unsubscribe link. - Secrets: the workflow reads
RESEND_API_KEYandWFHEAVEN_TO_EMAILfrom GitHub Secrets and passes them only to the send step. The mailer prints counts only. It removes the key and any email address from error messages before printing them, because Resend's error for the test sender names the address. - Every day: an email is sent even when there are no picks, so a missing email means something is wrong.
- Order: the memory of picked jobs (ADR 0006) is saved only after the email is sent. If sending fails, the run fails, GitHub emails the maintainer, and today's picks aren't remembered, so the next run can pick them again.
- No double sends: each daily email carries an idempotency key built from its content. If the same email is sent again within 24 hours, for example when a run is restarted, Resend doesn't deliver it twice.
- Testing: a "test email" mode on the manual Run workflow button sends an email built from fictional sample jobs. It reads no job source and doesn't change the memory.
Later: the WFHeaven domain¶
In Phase 2 of the demo, the email moved to picks@wfheaven.app, a domain
verified in Resend, with a Reply-To of privacy@wfheaven.app, and every
email got an unsubscribe link and headers. The daily run now emails each
tester from D1, and WFHEAVEN_TO_EMAIL is retired
(ADR 0013). The choice of Resend
stands.
Consequences¶
- Resend sees the content of each email and the recipient's address. The privacy page must name it when there are real users.
- Job details go to one private inbox. That isn't republishing, and each job still shows its apply link and source credit, as the terms require.
- A failed send delays the picks by a day instead of losing them.
- If the email is sent but saving the memory fails, the same picks can be sent once more the next day.
- Emails from
onboarding@resend.devmay land in the spam folder until a domain is verified. - Moving to another email service means changing one module,
mailer/send_email.py.