Message Scheduling
Send at a specific time, in the recipient's timezone, or at the next permitted moment inside a policy window.
Scheduling modes
| Mode | Behavior |
|---|---|
IMMEDIATE | Send now (default) |
AT | Send at an absolute UTC datetime |
LOCAL | Send at a local wall-clock time in the recipient's timezone |
WINDOW | Send at the next moment inside an allowed window |
OPTIMAL | EIE-predicted best send time per recipient |
RME_Message.builder()
.templateName('Quarterly_Statement')
.toContact(contactId)
.schedule('LOCAL', '09:00') // 9:00 AM recipient local time
.expiresAfterHours(12) // do not send if delayed beyond this
.send();
Quiet hours and policy windows
Channel policies define permitted windows per country and channel. A request that lands in a quiet window is held, not dropped, and released at the window boundary.
channel: SMS
country: US
allowedWindow: "08:00-21:00"
timezoneSource: RECIPIENT
onViolation: DEFER # DEFER | REJECT
Transactional categories can be exempted explicitly — a security alert should not wait until morning.
Expiration
Scheduled messages carry an optional expiry. A shipment notification that could not be sent for 14 hours is usually worse than no notification; expiresAfterHours cancels it and records Status__c = Expired.
Cancelling and rescheduling
RME_Scheduler.cancel(messageId);
RME_Scheduler.reschedule(messageId, Datetime.newInstance(2026, 8, 6, 14, 0, 0));
Scheduled work runs on the packaged scheduled Apex job. Confirm it is active in Setup → Scheduled Jobs after installation.
Continue to Intelligent Routing.
Was this helpful?
Last updated 1 month ago