[Event notifications] Chat scheduler
Table schemas
Alerts
- id - Primary key
- title - varchar
- user_id - Foreign key - users
- message_id - Foreign key - channels - default null
- trigger_at - datetime
- is_sent - boolean - default false
Channel_members
- last_viewed - datetime - default null
- last_alert_triggered_time - datetime - default null
Update the last viewed timestamp based on user activity
- When the user opens a manuscript, it opens the chat automatically
- The system marks the current time as the channel_user_last_viewed time
Create a scheduler
- Parses the table for unread messages that have been unread for 30 minutes
- Sends email notification to the desired recipient(s)
- Logs the event notification