Skip to content

feat: implement email digest (#371)#509

Merged
LaGodxy merged 1 commit into
MettaChain:mainfrom
omonxooo-commits:feature/371-email-digest
Apr 29, 2026
Merged

feat: implement email digest (#371)#509
LaGodxy merged 1 commit into
MettaChain:mainfrom
omonxooo-commits:feature/371-email-digest

Conversation

@omonxooo-commits
Copy link
Copy Markdown
Contributor

@omonxooo-commits omonxooo-commits commented Apr 29, 2026

Closes #371


Summary

Implements daily/weekly email digest feature per issue #371.

Changes

  • Schema: Added DigestFrequency enum and DigestPreference model with unsubscribeToken, frequency, enabled, lastSentAt
  • Migration: 20260429000000_add_email_digest — creates digest_preferences table
  • EmailDigestService: aggregates user notifications since last digest period, builds HTML digest template, sends via existing EmailService
  • DigestScheduler: cron jobs — daily at 08:00 UTC, weekly on Monday at 08:00 UTC
  • EmailDigestController: REST endpoints for preference management and one-click unsubscribe
  • EmailDigestModule: wired into AppModule

API Endpoints

Method Path Auth Description
GET /email-digest/preference JWT Get or create digest preference
PATCH /email-digest/preference JWT Update frequency/enabled
GET /email-digest/unsubscribe?token= None One-click unsubscribe

Acceptance Criteria

  • Aggregate notifications since last digest period
  • HTML digest template with notification list and unsubscribe link
  • Daily and weekly schedule via cron
  • Unsubscribe via token (no auth required)

- Add DigestFrequency enum (DAILY/WEEKLY) and DigestPreference model to schema
- Create migration for digest_preferences table with unsubscribe token
- EmailDigestService: aggregate notifications, build HTML template, send digest
- DigestScheduler: daily cron (8AM UTC) and weekly cron (Monday 8AM UTC)
- EmailDigestController: GET/PATCH /email-digest/preference, GET /email-digest/unsubscribe
- Wire EmailDigestModule into AppModule
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 29, 2026

@omonxooo-commits Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@LaGodxy LaGodxy merged commit 05def8c into MettaChain:main Apr 29, 2026
4 checks passed
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.

Implement Email Digest

2 participants