Schedule Send
Schedule a message to be sent at a specified date and time in the future.
Scheduling a Draft Message
State
Meaning
// Obtain the draftId and emailAddressId however makes sense for your application
const id = draft.id
const emailAddressId = senderEmailAddress.id
const sendAt = DateTime.now().plus({ day: 1 }).toJSDate() // Adjust this to the required time in the future
try {
const scheduledDraftMessage = await emailClient.scheduleSendDraftMessage({
id,
emailAddressId,
sendAt,
})
} catch (e) {
// Handle/notify user of errors
}// Obtain the draftId and emailAddressId however makes sense for your application
let id = draft.id
let emailAddressId = senderEmailAddress.id
let sendAt = Date().addingTimeInterval(+86400) // Adjust this to the required time in the future
let input = ScheduleSendDraftMessageInput(
id: id,
emailAddressId: emailAddressId,
sendAt: sendAt
)
do {
let scheduledDraftMessage = try await emailClient.scheduleSendDraftMessage(withInput: input)
} catch {
// Handle/notify user of errors
}Cancelling a Scheduled Draft Message
Listing Scheduled Draft Messages
Filter Option
Type
Meaning
Last updated