Learn R Programming

mRpostman (version 0.3.1)

since: Criteria Helper Functions for Custom Search

Description

Criteria helper functions to be combined inside a operator helper function as a custom request in custom_search.

Usage

since(date_char, negate = FALSE)

Arguments

date_char

A character vector with format "DD-Mon-YYYY", e.g. "01-Apr-2019". We opted not to use objects of type "date", since IMAP servers like this not so common date format.

negate

If TRUE, negates the search and seeks for "NOT search_criterion". Default is FALSE.

Value

A search string to be used as a custom_request parameter in custom_search function.

See Also

Other customsearch helper functions: AND, OR, before, flag, larger_than, older_than, on, sent_before, sent_on, sent_since, smaller_than, string, younger_than

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
# configure IMAP
library(mRpostman)
imapconf <- configure_imap(url="imaps://your.imap.server.com",
                           username="your_username",
                           password=rstudioapi::askForPassword()
                          )

# search
result <- imapconf %>%
    select_mailbox(mbox = "INBOX") %>%
    custom_search(custom_request = AND(since(date_char = "17-Apr-2019"),
                                       smaller_than(size = 512000)
                                      ))
# searches for messages Since "17-Apr-2019" AND Smaller Than  512KB.

# }
# NOT RUN {
# }

Run the code above in your browser using DataLab