Delay
As part of a Send in Courier, you can define the time to wait before delivering the message and Courier will handle. Courier supports one of three ways to delay
- delay by X milliseconds (
delay.duration
) - specify the ISO 8601 timestamp string (
delay.until
) - specify a Deliver Window using a partial implementation of opening_hours (
delay.until
). This also supports timezone offsets from within a user profiletimezone
key ormessage.to.timezone
.
Logging
When a delay is accepted via the API, you can verify it by viewing the Message Log for the request. You should see a Request Delayed
event that specifies the time in GMT that the send take place.
Example:
Duration
Specifying a delay.duration
will delay the send by this number of milliseconds. For example, this payload will send to the inbox only have 2 minutes.
DURATION IS ROUNDED UP TO NEXT MINUTE
When using delay.duration
, we will round up to the next minute
Timestamp
You can specify an ISO8601 timestamp string in delay.until
. Courier will calculate the delay and send the message at this time for you.
Delivery Window
You can specify a Delivery Window using a partial implementation of opening_hours (delay.until
). This also supports timezone offsets from within a user profile timezone
key or message.to.timezone
. Based on the current time and the opening_hours string, Courier will calculate if it can send right now (is open) or delay until the next window.
- By default, Delivery Window will calculate the timezone in UTC, however it can be overridden by the
timezone
key stored in the user profile or provided in the requestmessage.to.timezone
. Timezone can follow either IANA timezones or UTC+- syntax (UTC+4, UTC-5). - Opening hours calcuation is inclusive at the start of the range, and exclusive at the end of the range. For example, sending at Mo 08:00 exactly with Delivery Window
Mo-Fr 08:00-12:00
will not delay. Sending at Mo 12:00 exactly with Delivery WindowMo-Fr 08:00-12:00
will delay until Tu 08:00
Examples:
- Business Hours (Mo-Fr 09:00-17:00)
- Weekend (Fr-Mo 17:00-09:00)
- Only Mornings (Su-Sa 08:00-12:00)
- Single Day (Mo 09:00-12:00, 14:00-18:00)
- Same Day Different Entries (Mo 09:00-12:00; Mo 14:00-18:00)
- Non-Consecutive Entries (Mo 09:00-12:00; We 14:00-18:00)
- Only at 11am (Su-Mo 11:00-11:00)
Examples
PARTIAL OPENING HOURS SUPPORT
We currently don’t support the full opening_hours specifications like exceptions and public holidays. Please submit feedback to support@courier.com or your account team if Delivery Window is covering your use case for business hours or dynamic delays, please let us know.