Skip to content

One reminder email for people who came once - #145

Merged
Darknode-Official merged 1 commit into
mainfrom
feat/winback-email
Nov 29, 2026
Merged

Darknode-Official merged 1 commit into
mainfrom
feat/winback-email

Conversation

@Darknode-Official

@Darknode-Official Darknode-Official commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

What

People who sign up, use Darknode on one day and never come back now get one email, once, pointing them at the daily domain watch (the part that keeps working without them).

  • Who gets it (worker/winback.js pickWinBack):
    • verified address, account not disabled, banned or the owner's;
    • signed up 2 to 45 days ago, and not seen for 2 or more days;
    • used the Deck on a single day only, by the same rule the Owner page counts with (personOf);
    • no monitor in their personal workspace, and the weekly digest is off.
  • When: a daily cron at 0 15 * * *, production only, gated by WINBACK_CRON=on. At most 25 per run, oldest sign-up first. Each send is written to winback/{uid} before it is sent, so nobody gets two.
  • The email:
    • lists what the watch checks: the certificate, the registration, email/DNS records, and the website;
    • when the address is on its own domain, the button opens /check/<that domain>; webmail addresses go to the Overview instead;
    • says it is a one-time reminder, carries List-Unsubscribe headers, and has a signed turn-off link (/api/winback/stop, an HMAC distinct from the digest's).
  • Owner page:
    • a Reminder email panel: sent, came back after it, turned off, who the next run sends to, and a "Send me a test" button (/api/admin/winback, owner only);
    • each person's details show "Reminder email: Sent N d ago".
  • Fix found on the way: deleting an account left its digest/{uid} record behind. KEYED_BY_UID now covers digest and winback, so deletion and export both include them.
  • Legal: docs Privacy, TOS Section 14 and the changelog describe the email. This is a wording addition (a one-time service email with opt-out), so there is no TOS_VERSION bump.

Verified

  • npm test: 5234 passed. New tests cover:
    • the selection rules and the per-run cap;
    • the email copy, escaping, and the domain versus webmail cases;
    • the routes and the cron branching;
    • a full stubbed daily run: Google token, Auth batchGet, Firestore list/commit, the monitor Durable Object and Resend. It checks that only the right person gets an email, that the record is written before the send, that the stop link writes off:true, and that the digest token is rejected.
  • Email rendered and checked visually.
  • Owner panel checked in the real Deck build, with the admin API stubbed, at desktop and 390px.

Not verified

  • The live run against production Firestore and Auth, and the owner preview send, need the owner's sign-in.
  • No Firestore rules change: winback/ and digest/ have no client rules, so default deny applies and only the Worker touches them.

A daily Worker cron (15:00 UTC, production only, gated by WINBACK_CRON) emails, once per
account ever, people who used Darknode on a single day: verified, signed up 2 to 45 days
ago, not seen for 2 days, no monitor, digest off, not banned or the owner. The email points
at the daily domain watch and checks their own domain when the address is on one. Each send
is recorded before it goes out; a signed link turns reminders off.

Owner page: a Reminder email panel (sent, came back after it, turned off, next run, send me
a test) and a per-person line. Deleting an account now also removes its digest and reminder
records (the digest record was left behind before). Privacy, TOS Section 14 and the
changelog describe the email.
@Darknode-Official
Darknode-Official merged commit b05ed39 into main Nov 29, 2026
10 checks passed
@Darknode-Official
Darknode-Official deleted the feat/winback-email branch November 29, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant