Enhancement: Support for Vector or List of Emails for Multiple Recipients#197
Enhancement: Support for Vector or List of Emails for Multiple Recipients#197nikitoshina wants to merge 2 commits intor-lib:mainfrom
Conversation
| return(x$header$To) | ||
| } | ||
| if (length(val) > 1) { | ||
| x$header$To <- paste(val, collapse=",") |
There was a problem hiding this comment.
[air] reported by reviewdog 🐶
| x$header$To <- paste(val, collapse=",") | |
| x$header$To <- paste(val, collapse = ",") |
| return(x$header$Cc) | ||
| } | ||
| if (length(val) > 1) { | ||
| x$header$Cc <- paste(val, collapse=",") |
There was a problem hiding this comment.
[air] reported by reviewdog 🐶
| x$header$Cc <- paste(val, collapse=",") | |
| x$header$Cc <- paste(val, collapse = ",") |
| x$header$Bcc <- paste(val, collapse=",") | ||
| return(x) |
There was a problem hiding this comment.
[air] reported by reviewdog 🐶
| x$header$Bcc <- paste(val, collapse=",") | |
| return(x) | |
| x$header$Bcc <- paste(val, collapse = ",") | |
| return(x) |
|
Thanks and sorry this sat for so long! Once I reviewed it, I found tests suggesting that multiple recipients already works for gmailr/tests/testthat/test-gm_mime.R Lines 25 to 44 in 9630af7 And documentation also indicating that a vector can be provided to Line 45 in 9630af7 I also manually tested the functionality and it already works. So I added an example to hopefully make this more discoverable, but we don't need to change the code as per this PR. |
This pull request introduces the ability to pass a vector or list of emails to the function, enabling the creation of an email with multiple recipients. This feature addresses an issue encountered by our team, where there was an assumption that the function could naturally handle a vector/list of emails for sending to multiple recipients. A thorough search revealed no documentation on how to achieve this, indicating a gap in usability for users unfamiliar with the underlying mechanics of the function.
The addition of this feature simplifies the process of including multiple recipients, CCs, and BCCs, making it more accessible and user-friendly, especially for those not versed in the function's inner workings.