R/sent-before.R

Defines functions sent_before

Documented in sent_before

#' @inherit before
#' @family custom search
#' @examples
#' \dontrun{
#' # select folder & search
#' con$select_folder(name = "INBOX")
#' # search for messages SINCE "30-Ago-2019" AND SMALLER than 512KB.
#' res <- con$search(request = AND(sent_since(date_char = "30-Ago-2019"),
#'                                 smaller_than(size = 512000)))
#' }
#' @export
#'
sent_before <- function(date_char, negate = FALSE) {


  check_args(date_char, negate)

  # setting part of the search string

  if (!isTRUE(negate)) {
    out = paste0('(SENTBEFORE ', date_char, ')')

  } else {
    out = paste0('(NOT (SENTBEFORE ', date_char, '))')

  }

  return(out)

}

Try the mRpostman package in your browser

Any scripts or data that you put into this service are public.

mRpostman documentation built on Oct. 29, 2022, 1:16 a.m.