datawookie / emayili

An R package for sending email messages.
https://datawookie.github.io/emayili/
179 stars 27 forks source link

Sending email based on Gmail API #119

Closed asalavaty closed 2 years ago

asalavaty commented 2 years ago

Description

Hi Andrew. I am requesting this feature concerning recent Goggle announcements. Your package is indeed one of the best and most straightforward packages for sending email through R and it easily fits with shiny apps. Though, as you know Google recently announced that they will make the SMTP service unavailable. "On May 30, you may lose access to apps that are using less secure sign-in technology".

My question is that is there any way we could use your package for sending emails after May 30? or is there any way to implement Google API-based email sending through your package?

Cheers, Adrian

datawookie commented 2 years ago

Hi @asalavaty, thanks for getting in touch. It seems that this is not going to be a huge issue. I wrote up a quick article explaining how to work around it. Please let me know if you have any trouble or if there's anything unclear in the post. Thanks, Andrew.

StatisMike commented 2 years ago

@asalavaty I want to add something to the mix regarding sending e-mail through gmails Google API.

Way to setup email-sending through REST API calls is provided with gmailr package. But - I don't really recommend using it that way. I provide support for it in shiny.reglog, but especially as I am now redesigning the package I come to the conclusion that it is just a big drag.

The mail sending scope is classified as most vulnerable, the setup is pretty complicated and not really worth it. API connection is great for reading and organizing your mailbox, not for sending. Only if you have already registered app at google cloud it may be handy.

That said if you figure out a way to use gmailr and Oauth authentication without need for the oauth dance every few days (these refresh tokens seems to be very short-lived), ping me. Would love to hear about it, but I am almost certain that the workaround provided by @datawookie is much easier to do.

@datawookie Thanks for your straightforward and reliable package! Great work!

datawookie commented 2 years ago

@StatisMike thanks for this. Yes, I had a look at the API approach but decided that it would be better to stick with the clean SMTP authentication approach (just because it works with pretty much every other email service). Appreciate your perspective on this. :+1:

Thanks for your straightforward and reliable package! Great work!

Such a pleasure. I really enjoy working on this. If you have any suggestions or requests, please just create an issue.

asalavaty commented 2 years ago

Hi @asalavaty, thanks for getting in touch. It seems that this is not going to be a huge issue. I wrote up a quick article explaining how to work around it. Please let me know if you have any trouble or if there's anything unclear in the post. Thanks, Andrew.

Hi @datawookie Thanks for the prompt reply and for sorting out the issue. Your solution worked flawlessly!

asalavaty commented 2 years ago

@asalavaty I want to add something to the mix regarding sending e-mail through gmails Google API.

Way to setup email-sending through REST API calls is provided with gmailr package. But - I don't really recommend using it that way. I provide support for it in shiny.reglog, but especially as I am now redesigning the package I come to the conclusion that it is just a big drag.

The mail sending scope is classified as most vulnerable, the setup is pretty complicated and not really worth it. API connection is great for reading and organizing your mailbox, not for sending. Only if you have already registered app at google cloud it may be handy.

That said if you figure out a way to use gmailr and Oauth authentication without need for the oauth dance every few days (these refresh tokens seems to be very short-lived), ping me. Would love to hear about it, but I am almost certain that the workaround provided by @datawookie is much easier to do.

@datawookie Thanks for your straightforward and reliable package! Great work!

Hi @StatisMike Thanks for your suggestions. Yes, I tried gmailr as well but it has many complications that make it hard to establish a long-lasting emailing pipeline. Indeed emayili is super straightforward and easy to implement.