Key Concepts
Delay Types
Courier supports three methods for delaying message delivery:- Duration delay: Delay by a specific amount of time (e.g., 2 hours from now)
- Timestamp delay: Schedule delivery for an exact date and time
- Delivery window: Send only during specified business hours or time periods
Common Use Cases
- Reminder notifications: Send follow-up messages after a delay
- Business hour compliance: Ensure messages arrive during working hours
- Time zone configuration: Deliver at appropriate local times for users
- Campaign scheduling: Schedule promotional messages for optimal timing
- Workflow automation: Coordinate message timing with business processes
Configuration
Duration Delay
Delay message delivery by a specific number of milliseconds from the current time:Timing Precision: Duration values are rounded up to the next minute. For example, 90 seconds (90000ms) will be rounded to 2 minutes.
- 5 minutes:
300000(5 × 60 × 1000) - 1 hour:
3600000(60 × 60 × 1000) - 1 day:
86400000(24 × 60 × 60 × 1000)
Timestamp Delay
Schedule message delivery for a specific date and time using ISO 8601 timestamp format: Date only (midnight UTC):Delivery Window
Send messages only during specified time periods using business hour rules. Based on current time and the delivery window, Courier automatically determines whether to send immediately or delay until the next valid time window. Timezone Support:- Default: UTC timezone
- Delay object: Override with
delay.timezone(highest priority) - Request level: Override with
message.to.timezone - User profile: Override with
timezoneorzoneinfokey in user profile - Formats: IANA timezones (
America/New_York) or UTC offset (UTC-5)
message.delay.timezone(highest priority)message.to.timezoneor user profilezoneinfo- User profile
timezone UTC(default)
- Inclusive start: Messages sent exactly at window start time are delivered
- Exclusive end: Messages sent exactly at window end time are delayed to next window
- Business hours:
Mo-Fr 09:00-17:00 - Weekends only:
Sa-Su 00:00-23:59 - Morning hours:
Mo-Fr 08:00-12:00 - Split schedule:
Mo-Fr 09:00-12:00,14:00-18:00 - Specific day:
Mo 09:00-17:00
Timezone in Delay Object
You can specify timezone directly in thedelay object, which takes precedence over user profile timezone settings. This is especially useful when sending without user profiles.
Priority order for timezone resolution:
message.delay.timezone(highest priority)message.to.timezoneor user profilezoneinfo- User profile
timezone UTC(default)
delay.timezone:
- Sending to recipients without user profiles (just
emailorphone_number) - Overriding user profile timezone for specific messages
- Ensuring consistent timezone behavior across multiple recipients
email or phone_number in the to field and specify timezone in delay.timezone.
Timezone Field Behavior: The
delay.timezone field only applies when delay.until is an opening hours expression (e.g., “Mo-Fr 09:00-17:00”). For ISO timestamp until values, timezone is already included in the timestamp.Delivery Window Examples
Business hours with timezone in delay object:email or phone_number in the to field and specify timezone in delay.timezone. The message will be delivered during business hours in Eastern Time.
Multiple recipients with different timezones:
Limited Opening Hours Support: Courier supports basic time windows but not advanced features like holidays or exceptions. Contact [email protected] if you need more complex scheduling rules.
Monitoring
Message Logs
When a delay is accepted, the Message Log shows aRequest Delayed event with delivery timing details: