R/authenticate.R

Defines functions authenticate

Documented in authenticate

#' Authenticate with the gmail API.
#'
#' @description Simple convenience function to authenticate with gmail
#'              prior to sending e-mails.  This can be skipped if the user
#'              chooses to authenticate separately.
#' 
#' @param config_path file path to the \code{secretsanta} config JSON.
#'
#' @export
authenticate <- function(config_path) {
  config <- jsonlite::fromJSON(config_path)
  gmailr::gm_auth_configure(path = config$files$gmailr_credentials)
  gmailr::gm_auth(use_oob = FALSE)
}
ataustin/secretsanta documentation built on Nov. 27, 2024, 7:39 p.m.