Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support vector and list input #3

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions R/sg.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ sg_to <- function(x, ...) {

#' @export
sg_to.mime <- function(x, ...) {
emails <- rlang::list2(...)
emails <- unlist(rlang::list2(...), recursive = FALSE)
x$to <- lapply(emails, \(email) list(email = email))
x
}
Expand All @@ -73,7 +73,7 @@ sg_cc <- function(x, ...) {

#' @export
sg_cc.mime <- function(x, ...) {
emails <- rlang::list2(...)
emails <- unlist(rlang::list2(...), recursive = FALSE)
x$cc <- lapply(emails, \(email) list(email = email))
x
}
Expand All @@ -87,7 +87,7 @@ sg_bcc <- function(x, ...) {

#' @export
sg_bcc.mime <- function(x, ...) {
emails <- rlang::list2(...)
emails <- unlist(rlang::list2(...), recursive = FALSE)
x$bcc <- lapply(emails, \(email) list(email = email))
x
}
Expand Down Expand Up @@ -130,7 +130,7 @@ sg_attachments <- function(x, ...) {

#' @export
sg_attachments.mime <- function(x, ...) {
paths <- rlang::list2(...)
paths <- unlist(rlang::list2(...), recursive = FALSE)

attachments <-
lapply(paths, function(path) {
Expand Down