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

Specifying multiple attachments duplicates files... #9

Closed
peter-bastian opened this issue Apr 29, 2021 · 9 comments
Closed

Specifying multiple attachments duplicates files... #9

peter-bastian opened this issue Apr 29, 2021 · 9 comments

Comments

@peter-bastian
Copy link

peter-bastian commented Apr 29, 2021

I like what your sendgridr package does and very easily allows me to send mail via sendgridr. However, it appears that attachments() has a bug when I attempt to send multiple attachments.

For example, this works as expected, and I get one file in my email:
mail() %>%
from("someone@somewhere.com") %>%
to("me@gmail.com") %>%
subject("See attached files...") %>%
body("Please find attached the files you requested") %>%
attachments("File1.docx") %>%
send()

However, if I want to send multiple attachments, I use this:
mail() %>%
from("someone@somewhere.com") %>%
to("me@gmail.com") %>%
subject("See attached files...") %>%
body("Please find attached the files you requested") %>%
attachments("File1.docx") %>%
attachments("File2.xlsx") %>%
attachments("File3.pptx") %>%
send()

It does send the email, but I get two copies of each attachment.

@peter-bastian peter-bastian changed the title Multiple attachment file support... Specifying multiple attachments duplicates files... Apr 29, 2021
@mrchypark
Copy link
Owner

@peter-bastian Thank you for issue.

I notice that is bug about content_id and fixed with 3a335fa.

plz try.

@mrchypark mrchypark reopened this Apr 30, 2021
@peter-bastian
Copy link
Author

Not sure what you may be planning, but an alternative and more compact syntax would be something like this, if you can code it this way:

mail() %>%
from("someone@somewhere.com") %>%
to("me@gmail.com") %>%
subject("See attached files...") %>%
body("Please find attached the files you requested") %>%
attachments("File1.docx", "File2.xlsx", "File3.pptx") %>%
send()

@mrchypark
Copy link
Owner

mrchypark commented Apr 30, 2021 via email

@peter-bastian
Copy link
Author

Thank you very much for the quick fix...I can confirm that this syntax works now...
mail() %>%
@.") %>%
@.
") %>%
subject("See attached files...") %>%
body("Please find attached the files you requested") %>%
attachments("File1.docx") %>%
attachments("file2.txt") %>%
send()

I have found another bug that I will report in a separate issue.

@mrchypark
Copy link
Owner

@peter-bastian Thank you. Plz help me :)

@mrchypark
Copy link
Owner

@all-contributors please add @peter-bastian for bug

@allcontributors
Copy link
Contributor

@mrchypark

I've put up a pull request to add @peter-bastian! 🎉

@mrchypark
Copy link
Owner

@all-contributors please add @peter-bastian for bug

@allcontributors
Copy link
Contributor

@mrchypark

I've put up a pull request to add @peter-bastian! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants