Implement Entity-Level Subscriptions for Chapters and Events
- Dominant language
- Python
- Stars
- 451
- Forks
- 707
- Avg merge
- 22h 59m
- Merged PRs (30d)
- 91
Description
Implement entity subscription and notification system for Chapters and Events. Users can subscribe to entities at two levels: all entities of a type (global) or specific individual entities. Notifications are triggered based on creation, updates, and event deadlines. part of #3227
Notification Rules :
Chapters :
All Chapters Subscription
- When a new chapter is created, send an email notification to all users who subscribed to "all chapters"
Specific Chapter Subscription
- When a specific chapter is updated, send an email notification only to users who subscribed to that particular chapter
Events :
All Events Subscription
- When a new event is published, send an email notification to all users who subscribed to "all events"
Specific Event Subscription
- When a specific event is updated, send an email notification only to users who subscribed to that particular event
- When a specific event's deadline is approaching (7 days, 3 days, and 1 day before), send a reminder email to users who subscribed to that particular event
Tasks
1. Chapter Notifications
- [x] Signal handler on Chapter model post_save
- [x] Detect new chapter creation vs updates
- [x] Query subscribers based on trigger type
- [x] Queue notifications to Redis Stream
2. Event Notifications
- [x] Signal handler on Event model post_save
- [x] Detect new event creation vs updates
- [x] Create management command for deadline reminders
- [x] Schedule via cron
- [x] Queue notifications to Redis Stream
3. Worker Updates
- [x] Handle new message types for chapter/event notifications
- [x] Implement email delivery with retry logic and dlq
- [x] Support both global and specific entity subscriptions
- [x] Unit tests
**Are you going to work on implementing this?**
- [x] Yes
- [ ] No
Contributor guide
Assessment
This issue has not been assessed yet.