Fix daily email timing to work across all timezones

Critical fix: Task now runs every hour instead of once at 6 AM UTC.
This ensures users in all timezones receive their email at 6 AM local time.

Changes:
- Run task every hour instead of once daily
- Check if it's 6-7 AM in user's timezone (1 hour window)
- Track sent emails in Notification model to prevent duplicates
- Add 'daily_email' notification type

Without this fix, users in timezones where 6 AM UTC is not morning
would never receive their daily email.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Keith Smith
2026-01-09 09:34:39 -07:00
co-authored by Claude Sonnet 4.5
parent 03cfdea42d
commit aca8abca56
3 changed files with 25 additions and 3 deletions
+1
View File
@@ -17,6 +17,7 @@ class Notification(models.Model):
('overdue', 'Overdue'),
('shared', 'Task Shared'),
('comment', 'Comment'),
('daily_email', 'Daily Email'),
]
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)