Skip to contents

Searches Gmail messages and returns matching thread IDs. Useful for finding the thread_id to pass to mc_send() when replying into an existing conversation.

Usage

mc_thread_find(query, n = 5, after = NULL, before = NULL)

Arguments

query

Gmail search query. Supports the same syntax as the Gmail search box (e.g., "from:brandon subject:cottonwood").

n

Maximum number of results. Default 5.

after, before

Optional date filters. Date object or character string in "YYYY-MM-DD" form. Translated to Gmail's after: / before: operators (inclusive/exclusive semantics follow Gmail's behaviour: after: is inclusive, before: is exclusive).

Value

A data frame with columns thread_id, from, subject, and date, sorted by most recent first.

Examples

if (FALSE) { # \dontrun{
mc_thread_find("from:brandon.geldart subject:cottonwood")
mc_thread_find("from:brandon newer_than:7d")
mc_thread_find("newsletter", after = Sys.Date() - 7)
} # }