Skip to content

Commit cbb35e1

Browse files
authored
Merge pull request #79 from vincentarelbundock/gmailr3
`gmailr` 3.0.0 renamed functions
2 parents 2f6bdae + f2a5e83 commit cbb35e1

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

NAMESPACE

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ importFrom(dplyr,rename)
118118
importFrom(dplyr,right_join)
119119
importFrom(dplyr,select)
120120
importFrom(dplyr,ungroup)
121-
importFrom(gmailr,create_draft)
122121
importFrom(gmailr,gm_auth_configure)
123-
importFrom(gmailr,mime)
124-
importFrom(gmailr,send_draft)
122+
importFrom(gmailr,gm_create_draft)
123+
importFrom(gmailr,gm_mime)
124+
importFrom(gmailr,gm_send_draft)
125125
importFrom(googlesheets4,range_write)
126126
importFrom(googlesheets4,read_sheet)
127127
importFrom(purrr,map)

R/actions.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,12 @@ draft_proofing <- function(article, update=TRUE) {
241241
# body <- render_template(acc, "gmail_proofing")
242242
# acc_meta <- as.data(as.article(acc))
243243
# Note this should be from current editor's address
244-
# email <- gmailr::mime(From = "dicook.rj@@gmail.com",
244+
# email <- gmailr::gm_mime(From = "dicook.rj@@gmail.com",
245245
# To = acc_meta$email,
246246
# Subject = paste("R Journal article proofing",
247247
# format(acc_meta$id)),
248248
# body = body)
249-
# gmailr::create_draft(email)
249+
# gmailr::gm_create_draft(email)
250250
#
251251
#
252252
# }
@@ -259,12 +259,12 @@ draft_proofing <- function(article, update=TRUE) {
259259

260260

261261
#' @param drafts list of \code{gmail_draft} objects
262-
#' @importFrom gmailr send_draft
262+
#' @importFrom gmailr gm_send_draft
263263
#' @export
264264
#' @rdname proofing
265265
proofing_article <- function(drafts) {
266266
for (draft in drafts) {
267-
gmailr::send_draft(draft)
267+
gmailr::gm_send_draft(draft)
268268
}
269269
for (id in names(drafts)) {
270270
update_status(id, "out for proofing")

R/submissions.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ create_submission_directory <- function(id) {
7878
}
7979

8080
as.article.gmail_message <- function(msg, ...) {
81-
txt <- sub("\\[.*", "", gmailr::body(msg)[[1L]])
81+
txt <- sub("\\[.*", "", gmailr::gm_body(msg)[[1L]])
8282
txt <- gsub("\r\n(\r\n)+", "\n", txt)
8383
dcf <- read.dcf(textConnection(txt))
8484
dcf <- setNames(dcf, tolower(colnames(dcf)))
@@ -270,16 +270,16 @@ download_submission_file <- function(url, path = get_articles_path()) {
270270

271271
consume_submissions <- function(subs) {
272272
for (msgid in names(subs)) {
273-
gmailr::modify_message(msgid, remove_labels = "UNREAD")
273+
gmailr::gm_modify_message(msgid, remove_labels = "UNREAD")
274274
}
275275
}
276276

277-
#' @importFrom gmailr mime create_draft
277+
#' @importFrom gmailr gm_mime gm_create_draft
278278
draft_acknowledgements <- function(subs) {
279279
authorize(c("read_only", "modify", "compose"))
280280
acknowledge_sub <- function(sub) {
281281
body <- render_template(sub, "gmail_acknowledge")
282-
email <- gmailr::mime(
282+
email <- gmailr::gm_mime(
283283
From = "rjournal.submission@gmail.com",
284284
To = sub$authors[[1L]]$email,
285285
Subject = paste(
@@ -288,7 +288,7 @@ draft_acknowledgements <- function(subs) {
288288
),
289289
body = body
290290
)
291-
gmailr::create_draft(email)
291+
gmailr::gm_create_draft(email)
292292
}
293293
ans <- lapply(subs, acknowledge_sub)
294294
names(ans) <- vapply(subs, function(s) format(s$id),
@@ -349,11 +349,11 @@ acknowledge_revision <- function(article) {
349349
#' #' Send submission acknowledgement drafts
350350
#' #'
351351
#' #' @param drafts list of \code{gmail_draft} objects
352-
#' #' @importFrom gmailr send_draft
352+
#' #' @importFrom gmailr gm_send_draft
353353
#' #' @export
354354
#' draft_acknowledge_submissions <- function(drafts) {
355355
#' for (draft in drafts) {
356-
#' gmailr::send_draft(draft)
356+
#' gmailr::gm_send_draft(draft)
357357
#' }
358358
#' for (id in names(drafts)) {
359359
#' update_status(id, "acknowledged", replace=FALSE)

0 commit comments

Comments
 (0)