Future and local sends
Some notifications are scheduled: a reminder at 9 am, a campaign next Tuesday. The service stores the intent and a scheduler releases it at the right moment.
Storing time correctly
- Store absolute instants in UTC to avoid ambiguity.
- Store the user timezone separately so local hour sends compute the correct UTC instant.
- Beware daylight saving shifts that move local 9 am relative to UTC.
The scheduling engine
A common design is a time bucketed queue or a delay queue. A poller scans buckets due now and enqueues them for normal processing. This keeps the hot path simple.
Quiet hours
Many systems honor quiet hours, delaying non urgent sends that would land at night for the user, computed from their timezone.
Key idea
Scheduling stores UTC instants plus user timezone, releases due items from time buckets, and honors quiet hours for local delivery.