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

(Nodemailer) Why isn't this supported anymore? #29

Open
IonicaBizau opened this issue Nov 20, 2016 · 29 comments
Open

(Nodemailer) Why isn't this supported anymore? #29

IonicaBizau opened this issue Nov 20, 2016 · 29 comments
Labels

Comments

@IonicaBizau
Copy link

Maybe can I adopt it? Or is there a specific reason for deprecation?

@mbernier
Copy link
Contributor

It is not discounted completely, but our new v3 API was a complete change from the old API in form, function, structure, everything. So, it made sense to try something new within our libraries as well.

We are open to bringing this back if it's something we absolutely need to bring back, but so far our new library is working really well much fewer dependencies.

@IonicaBizau
Copy link
Author

I was looking at the nodemailer yesterday and what I liked about it is that it allows the same public interface, across multiple providers.

@mbernier
Copy link
Contributor

That totally makes sense. One thing we were definitely doing in our rewrite was removing the constraints we had from other dependencies but there is definite up side to having the consistent interface.

What is your use case? Are you integrating with a 3rd party service that uses nodemailer or is it just that having the ability to switch providers easily is ideal? Something else?

Thank you!!!

@IonicaBizau
Copy link
Author

@mbernier Initially I wanted to build a general plugin for @Bloggify to send emails. But since I use SendGrid, I ended with creating bloggify-sendgrid.

Still, would be nice to solve this issue one day, so then we can have a general module for sending emails via nodemailer. 😁

@mbernier mbernier changed the title Why isn't this supported anymore? (Nodemailer) Why isn't this supported anymore? Nov 21, 2016
@mbernier
Copy link
Contributor

I updated the title here and marked it as a question. I am interested to see what other people in the Node community think, because this is not the first request on this.

We want to support what you all NEED from us, in order to make your jobs easier.

It is totally possible for us to support nodemailer in a helper, as well as continue to support our own helpers. And we will do this, if we see that support for this feature is warranted and useful to our community.

To everyone else who's reading this - if you want nodemailer support in a helper - throw a thumbs up on this comment or on @IonicaBizau's original comment to let us know!!

@IonicaBizau
Copy link
Author

I agree! 👍

@elboletaire
Copy link

elboletaire commented Nov 23, 2016

So... what is the recommended library for sending e-mails in nodemailer using SendGrid? This is not very clear to me.

@thinkingserious
Copy link
Contributor

@elboletaire We don't have a recommended nodemailer library currently.

We only officially support this Node.js library: https://github.com/sendgrid/sendgrid-nodejs

I hope that helps. Thanks!

@mderazon
Copy link
Contributor

mderazon commented Dec 4, 2016

I also would like to see nodemailer continue to be supported. Not that I have any problem with the official node module, it's just that I think it's better to have a provider agnostic way to send email.
I think that this kind of "openness" is better for Sendgrid as well. In fact, when I was first looking to send emails with node, I started using nodemailer and since Sendgrid had a transport plugin for nodemailer it was an easy choice for me. So this kind of openness made me a Sendgrid customer in the first place :-)

If this module uses the official sendgrid module under the hood and the official module does all the heavy lifting, isn't it only a matter of keeping the underlying module up to date and keeping the nodemailer api working?

With all that said, I understand if you don't want to put more resources into this module, in that case, maybe it's best if you let the community pick it up. I already see pull requests like this one that should move this forward.

@davesag
Copy link

davesag commented Dec 7, 2016

I'm choosing an emailer solution right now for an MVP project I am working on and in the past I have always chosen SendGrid as, in the past, it's been trivial to wire it into NodeMailer. I like NodeMailer because, during development or while running integration tests, I can easily drop back to the nodemailer-stub-transport or my mac's built-in Sendmail smtp server. I've looked at the 'official' sendgrid-nodejs library and the huge number of outstanding issues / PRs are a concern, and there does not appear to be any equivalent to the stub-transport for use in testing.

So I second the comment from @mderazon above. If Sendgrid does not have the resources to support its nodemailer transport then please could you release it into the wild and let the broader community maintain it. In the meantime I'll use this version which appears to be the most current fork.

neagle pushed a commit to national-go-center/site that referenced this issue Dec 8, 2016
Got set up with SendGrid to provide SMTP service for sending actual
emails. Right now it's just sending emails to KeystoneJS admins when
there's a new enquiry.

The emails need styled, and they're set up in an over-complicated
manner. They need to be simplified and given NGC branding. We'll
eventually re-use this for sending emails to users, etc.

Nodemailer's integration with SendGrid is a bit sketchy right now: we're
relying on a dumb fork of the no-longer-officially supported library.

See this issue:
sendgrid/nodemailer-sendgrid-transport#29

The actual SendGrid account is managed through Azure.
@Scorpiion
Copy link

Hi @mbernier,

The reason I came to this thread was because I was going to setup a Ghost blog with Sendgrid and Ghost uses nodemailer, but I don't want to add username and password to my account in the blog config, in my opinion that is just wrong. I want to use an API key.

I don't know how many other projects use nodemailer, but if there are many other big projects like Ghost that does then maybe it would be good to either make pull requests to said projects to use your new official API libraries (that looks pretty nice btw), or to make a basic nodemailer wrapper around your new client so that it supports the basics of sending emails using a secure API key.

Cheers, Robert

@moravcik
Copy link

I have just tried nodemailer-sendgrid-transport with new account created via Heroku and it seems it is working. Is it ok to use it in production?

@thinkingserious
Copy link
Contributor

Hi @moravcik,

Yes, the current version (that supports the v2 Web API), while no longer supported, is not being sunset.

Welcome to SendGrid! Glad to have you aboard :)

With Best Regards,

Elmer

@alexanderknapstein
Copy link

Looking forward for an official SendGrid V3 transport for nodemailer.

@bitmage
Copy link

bitmage commented Aug 23, 2017

Eh, I don't like their native API very much. Lots of object initialization. Doesn't feel very idiomatic for Node.js.

I just decided to call their API directly, and the code came out much cleaner:

const api = require('law-axios')
const sendgrid = api({
  json: true,
  domain: 'https://api.sendgrid.com/v3/',
  headers: {
    Authorization: 'Bearer ' + process.env.SENDGRID_KEY
  }
})

const body = {
  personalizations: [{to: [{email: to, name: toName}], subject}],
  from: {
    email: from,
    name: fromName,
  },
  reply_to: {
    email: from,
    name: fromName,
  },
  subject,
  content: [
    {type: 'text/html', value: html}
  ]
}
sendgrid('POST /mail/send', body, done)

Yeah, the cross-compatibility would be nice, but I'm willing to swap out 30 lines of code in the event that we switch carriers.

@thinkingserious
Copy link
Contributor

Thanks for sharing your solution @bitmage! If you have a moment, we would like to send you some swag.

Have you checked out the new version of our SDK? It should be released very soon.

@jsdevel
Copy link

jsdevel commented Oct 12, 2017

I'm on a project where we use SES and we also need to send out email. Nodemailer is really easy to use with ses, smtp, and a variety of communication transports.

👎 for dropping nodemailer support.

@thinkingserious
Copy link
Contributor

Hi @jsdevel,

Please follow this issue for progress :)

@oliviertassinari
Copy link

oliviertassinari commented Mar 29, 2018

GitHub as an archive feature function, it would make it easier to understand for newcomers.

capture d ecran 2018-03-29 a 15 52 38

@thinkingserious
Copy link
Contributor

That's interesting @oliviertassinari, I was not aware of this feature. I will look into whether that would be appropriate for this repo. For now, I'm thinking the announcement on the README should be sufficient.

With Best Regards,

Elmer

@Berkmann18
Copy link

Was there any update regarding the integration of the new API from sendgrid?

@elboletaire
Copy link

elboletaire commented Jul 5, 2018

Yeah, switch to latest version of nodemailer and you have it: https://github.com/nodemailer/nodemailer-sendgrid

@DaddyWarbucks
Copy link

I think it would be great to link to the nodemailer-sendgrid (https://github.com/nodemailer/nodemailer-sendgrid) library if this is no longer supported.
I just struggled for a few hours trying to figure this out. With a fresh Sendgrid account (via Heroku), I installed nodemailer and nodemailer-sendgrid-transport.

Following the the installation instructions in this repo: https://github.com/sendgrid/nodemailer-sendgrid-transport/blob/master/USAGE.md

var nodemailer = require('nodemailer');
var sgTransport = require('nodemailer-sendgrid-transport');

// api key https://sendgrid.com/docs/Classroom/Send/api_keys.html
var options = {
  auth: {
    api_key: process.env.SENDGRID_API_KEY
  }
}

// or

// username + password
var options = {
  auth: {
    api_user: 'SENDGRID_USERNAME',
    api_key: 'SENDGRID_PASSWORD'
  }
}
  
var mailer = nodemailer.createTransport(sgTransport(options));

mailer.sendMail( {...properEmailStugg} ).then((resp) => {
// resp = undefined
// this fails silently...
// It did not throw an error and went to this .then() but resp was undefined and the 
// email was never sent...very frustrating
})

The sendMail function does not throw an error, but instead returns resp as undefined

For anyone reading this, I would recommend using the nodemailer-sendgrid package instead. But, note the difference in the options setup. It requires { apiKey: 'blah' } not { auth: { api_key: 'blah' } }

@thinkingserious
Copy link
Contributor

Thanks for the heads up @DaddyWarbucks! I've added this to our backlog for review, it seems like a solid alternative until we can get this repo re-created here.

@sheerun
Copy link

sheerun commented Sep 19, 2018

Can I use smtp transport of nodemailer with sendgrid? What's correct configuration?

@thinkingserious
Copy link
Contributor

Hello @sheerun,

We have a solution in the works, but it's still on the backlog.

With Best Regards,

Elmer

@kusold
Copy link

kusold commented Oct 24, 2019

If this is no longer supported, you should take down https://sendgrid.com/blog/sending-email-nodemailer-sendgrid/

It's the top link when searching "sendgrid nodemailer"

For future readers: this is the latest solution https://github.com/nodemailer/nodemailer-sendgrid

@Berkmann18
Copy link

As most people should have known by now, this project was moved to the main repo under the mail package.

@ka05
Copy link

ka05 commented Oct 28, 2020

ematiu created a PR #71 to update the README.md. It would be great to see the verbiage reviewed and get that PR merged in. That way others who came across this repo via the SendGrid blog article @kusold mentioned, can be made aware that this is replaced by the npm package @sendgrid/mail within the following repo:
https://github.com/sendgrid/sendgrid-nodejs

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

No branches or pull requests