Skip to content

Daily email

Every day, the daily collection workflow emails each tester their picks with Resend, from picks@wfheaven.app. ADR 0007 explains the choice.

What's in the email

The subject is WFHeaven picks: <date> (<N> jobs), for example WFHeaven picks: 2026-12-05 (3 jobs).

For each pick, the email shows:

  • the job title and company
  • the salary as the posting gives it, or Not listed
  • why it fits: the matched title, skills, languages, and level words, and the experience the posting asks for, such as asks 2-4 years
  • Location: where the job is open, such as worldwide or open to EMEA, APAC
  • Watch out: the posting's timezone requirement, if it has one, such as At least 4 hours overlap with CET
  • the Apply link that the source's terms require: the Himalayas applicationLink, the job's page on Jobicy, or the job's page on Remote OK (its url, as a normal link)
  • the source credit, as text with a link to the job board

Remote OK jobs show no text from the posting's description: the experience asked, the timezone requirement, and the sentence behind an unclear location are replaced with a note to read the job page (Job sources). Their title, company, salary, location label, credit, and link stay.

A pick that's an AI-training gig, with ai_training: mixed, has [AI-training gig] after its title.

After the picks come up to three more sections:

  • Worth checking: up to three jobs that would be picks, but whose location is unclear. Each shows the sentence that made it unclear. See How matching works.
  • AI-training gigs (optional): with ai_training: separate, up to three AI-training gigs that would be picks, each tagged, with salary, location, and the apply link. See AI-training gigs.
  • Near misses: jobs that matched skills or languages but no target title. See Near misses.

The email has an HTML version and a plain-text version. Your email app shows the one it supports.

At the bottom, the email says why the tester gets it, and has an Unsubscribe and delete my data link and a link to the privacy notice. It also has the List-Unsubscribe and List-Unsubscribe-Post headers, so mail apps can show their own unsubscribe button. Replies go to privacy@wfheaven.app. See ADR 0013.

On a day with no picks, you still get a short email that says so, with the jobs worth checking, the AI-training gigs, and the near misses. If no email arrives, something went wrong.

How sending works

For each tester, daily/daily_run.py:

  1. ranks the jobs with rank_result from ranker/rank_jobs.py, skipping jobs already sent to that tester
  2. builds the email with mailer/send_email.py, with the tester's unsubscribe link, and sends it with Resend's HTTP API
  3. only if sending succeeded, saves keyed hashes of the picks in D1 (Remember picked jobs)

If sending fails for one tester, the others still get theirs, and the run fails at the end, so GitHub emails you. The failed tester's picks aren't remembered, so the next run can pick them again.

Each daily email carries an idempotency key made of the tester's ID and the date. If you restart a run the same day, Resend doesn't deliver the same tester's email twice within 24 hours. A second run usually picks different jobs, because the first run's picks are remembered, so its email differs. Resend then refuses the key with 409 invalid_idempotent_request. The run counts that tester as Already emailed today, skipped, not as a failure.

Secrets

The workflow reads these repository secrets:

Secret What it holds
RESEND_API_KEY A Resend key with sending access, limited to wfheaven.app
UNSUBSCRIBE_KEY Signs the unsubscribe links. The same value as the Worker's secret.
WFHEAVEN_HASH_KEY Makes the keyed hashes of sent jobs
CLOUDFLARE_API_TOKEN A Cloudflare token with D1 Edit permission, to read testers and save picks
CLOUDFLARE_ACCOUNT_ID The Cloudflare account that holds the database
HIMALAYAS_API_KEY Raises the Himalayas read limit; used by the collector

To set one, run gh secret set NAME, or open the repository on GitHub, click Settings, and then click Secrets and variables > Actions. The steps are in Deploy Phase 2. The testers' addresses come from D1; WFHEAVEN_TO_EMAIL isn't used anymore.

The logs and the run summary are public, so they never show a key, an address, or job details. The run prints only counts. If Resend returns an error, the mailer removes the key and any email address from the message before printing it.

Send a test email

You can check the email without collecting jobs, so Himalayas isn't read again:

  1. On GitHub, open the repository and click Actions.
  2. Click Daily collection, and then click Run workflow.
  3. Under mode, choose test email.
  4. Click the green Run workflow button.

The run ranks the fictional jobs in samples/jobs-sample.json against each tester with the maintainer role, and sends them an email whose subject starts with [Test]. Other testers get nothing. It doesn't read any job source and doesn't change the memory of picked jobs. The sample jobs link to example.com. If D1 has no maintainer, the run fails with a hint to run daily/add_tester.py.

Preview the email on your computer

To see the email without sending it, rank the sample jobs and use --preview:

python3 ranker/rank_jobs.py samples/jobs-sample.json --out data/picks.json
python3 mailer/send_email.py data/picks.json --test --preview data/email

Open data/email/email.html in a browser, or read data/email/email.txt. Nothing is sent, and you don't need the secrets. The preview has no unsubscribe footer; only the daily run adds it.

When sending fails

The Rank and email each tester step shows Resend's answer, without the key or any address. It numbers the testers instead of naming them.

Answer What to do
401 or 403 with missing_api_key or restricted_api_key Check RESEND_API_KEY. Create a new key in Resend if needed.
403 validation_error Check that wfheaven.app is verified in Resend, and that the key may send from it.
409 invalid_idempotent_request Not a failure: an earlier run already emailed this tester today. The step prints already emailed today, skipped.
429 A sending limit was reached. The mailer retries once. Try again the next day.
500 or 503 Resend had a problem. The mailer retries once. Restart the run later.
Couldn't reach Resend A network problem. Restart the run later.

To restart a run, open it and click Re-run jobs. A rerun of a failed run is stopped if the run already reached Collect jobs, because the once-a-day guard allows one collection a day (Daily trigger). The picks of an unsent email aren't remembered, so the next day's run can send them.

Known limits

  • The salary is shown as the posting gives it, without converting currencies.
  • Resend's free plan sends 100 emails a day, which is why the demo allows at most 20 testers.