Files
KomediruzeckiandGitHub bbb0b6896a feat(email): branded transactional emails, welcome for Google signups, bills reminders, prod crons (#347)
Every mail Token Circles sends now comes from a shared branded module
(worker/src/emailTemplates.ts, modeled on a proven pure-renderer design):
orbital dark shell (night page, hosted logo + serif wordmark, small looping
orbit GIF ornament with a standalone first frame for clients that freeze
GIFs), bulletproof 600px table layout with all-inline styles, dark-only
color-scheme meta, hidden preheader, and a footer with app / about / GitHub /
Terms / Privacy / Contact links plus a per-mail 'why you got this' line and
unsubscribe where applicable. Every renderer returns { subject, html, text }
— pure, snapshot-testable, with a plain-text twin now sent through Resend.

Rebranded + rewired: welcome, account-exists notice, password reset, budget
alert, spending report, test emails, support acknowledgement. Reminder
amounts now render in the profile's display currency (settings.currency,
EUR default) instead of hardcoded dollars.

Gaps closed:
- Brand-new GOOGLE signups now get the same welcome email as email/password
  registrations (resolveGoogleUser returns a created flag; the OAuth callback
  sends best-effort so a mail failure can never break the redirect).
- The legacy upcoming-bills reminder finally ported to the worker: daily cron
  (0 8 * * * UTC), settings toggle email_bills_reminders (matching the legacy
  key), plan-gated like the other reminders, same quota + per-day dedup, plus
  test-email/trigger types and a Settings toggle + preview button.
- Scheduled reminders now actually fire in PRODUCTION: env.prod gets the
  triggers block (bills daily, budget alerts Mondays, spending reports
  1st + 15th) — previously crons existed only in env.dev.

Plan gating is unchanged and verified: reminders and their test/preview
endpoints require the paid emailReminders feature (requireFeature +
eligible()); welcome/reset/support mails go to everyone.

Asset: frontend/public/email/orbit.gif (144px, 36 frames, 71KB) generated
from the OrbitSpinner design. 10 new worker tests cover every renderer
(branding contract, escaping, currency, null-on-empty, test subjects);
worker suite 147 green, frontend 607 green.
2026-07-16 21:07:34 +02:00
..