From d06597aad179bd239e95eaed56956b049a050519 Mon Sep 17 00:00:00 2001 From: Kristof Meers Date: Tue, 27 May 2025 16:36:48 +0200 Subject: [PATCH] Added send_deferred function --- R/ms_outlook_email.R | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/R/ms_outlook_email.R b/R/ms_outlook_email.R index 2006bca..75d1718 100644 --- a/R/ms_outlook_email.R +++ b/R/ms_outlook_email.R @@ -342,6 +342,23 @@ public=list( self$sync_fields() }, + send_deferred=function(when, tz = Sys.timezone()) + { + if (!inherits(when, "POSIXct")) { + when <- tryCatch( + as.POSIXct(when, tz = tz), + error = function(e) NA + ) + } + if (is.na(when)) { + stop("Invalid date/time for deferred send", call.=FALSE) + } + utc_time <- format(when, tz = "UTC", format = "%Y-%m-%dT%H:%M:%S") + prop <- list(list(id="SystemTime 0x3FEF", value=utc_time)) + self$update(singleValueExtendedProperties=prop) + self$send() + }, + create_reply=function(comment="", send_now=FALSE) { op <- "createReply"