RDCOMClient Outlook Add Reminder in R

Viewed 63

I am using this function in R to sending emails, however, I would like to add also "Add Reminder" to the emails in order to remind the action recipients later on. Is it possible?

Thank you

library(RDCOMClient)
mail_fun <- function(email, name, number) {
  Outlook <- COMCreate("Outlook.Application")
  Email = Outlook$CreateItem(0)
  # Email parameters
  #Email[["sentonbehalfofname"]] = ""
  Email[["to"]] = email
  Email[["cc"]] = ""
  Email[["bcc"]] = ""
  Email[["importance"]] = "2"
  Email[["readreceiptrequested"]] = FALSE
  Email[["originatordeliveryreportrequested"]] = FALSE
  Email[["subject"]] = paste0("Confirm your Telia SIM card delivery with the phone number: ", number)
  Email[["Body"]] = paste0("Dear ", name,",", "\n", "\n", "I would like to ask you for a confirmation that a new Telia SIM card with the phone number: ", number, " was delivered to you.", 
                           " Your confirmation is very important for a successful porting from H3Gi to Telia. The porting is planned for September 14th 2021.", "\n",
                           "In case you have not received the SIM card yet, please let us know your delivery address and we will send you a new SIM card.",
                           "\n", "\n", "Thank you for your cooperation.", "\n", "\n", "Best regards,", "\n", "Jaroslav Kotrba")
  # Email send
  Email$Send()
}

# Send
mapply(mail_fun, DK$email, DK$name, DK$number)

enter image description here

1 Answers

You are interested in setting up the MailItem.FlagRequest property which returns or sets a string that indicates the requested action for a mail item. By default, a mail item is not marked with any flag and the default value for this property is the empty string.

Email[["flagrequest"]] = "Reply"
Related