feat(notifications): add scheduled digest email service#1014
Merged
Olowodarey merged 2 commits intoJun 23, 2026
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
|
@ussyalfaks great job clean code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
closes #1006
digest_frequencycolumn (daily | weekly | off, defaultoff) touser_preferencesso users can opt into digest emailsemailcolumn tousers(required to resolve a send address per user)NotificationDigestStateentity that tracks the last sent period per user (YYYY-MM-DDfor daily,YYYY-WNNfor weekly) to enforce idempotencyDigestServicewith two configurable cron jobs (registered dynamically viaSchedulerRegistry) that fan out per-user digest emails each daily/weekly periodemail-templates.tswith adigesttemplate type that renders a bulleted HTML + plain-text summary of unread notificationsBehaviour
digest_frequency = 'off'oremail_notifications = falseare never emailedemailon file are silently skippedEnvironment variables
DIGEST_ENABLEDtruefalseto disable all digest jobs at startupDIGEST_DAILY_HOUR_UTC8DIGEST_WEEKLY_DAY1Test plan
digest_frequency = 'daily'andemail_notifications = trueon a user with unread notifications — confirm one email queued per dayemail_notifications = false— confirm no email sentdigest_frequency = 'off'— confirm no email sentemailnull on a user — confirm skipped silently