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

Add support for 3rd party APIs such as mailgun #4

Open
adamlesniak opened this issue Sep 15, 2016 · 2 comments
Open

Add support for 3rd party APIs such as mailgun #4

adamlesniak opened this issue Sep 15, 2016 · 2 comments
Labels

Comments

@adamlesniak
Copy link
Collaborator

adamlesniak commented Sep 15, 2016

Subject is self explanatory I believe it would be nice feature and we could standardise this module.

@fritx
Copy link
Owner

fritx commented Mar 25, 2018

Agreed, what could we do next?

@fritx fritx added the plan label Mar 25, 2018
@justin713
Copy link
Collaborator

Looks easy enough, although I do believe Nodemailer would need to (and should) be upgraded up to its most recent release. The createTransport() method needs to be adjusted to accept any arbitrary transport configuration.

Currently, the transport is hard-coded to SMTP:

// index.js
var transporter = nodemailer.createTransport('SMTP', options.smtp);

Nodemailer can be made to use any arbitrary transport that implements at least one send() method and two properties, name and version. (See Nodemailer docs regarding transports.).

So, one could have the following:

// index.js
 var transporter = nodemailer.createTransport(transport);

...where transport is a valid transport object. In the case of Mailgun, there's already a module for that: nodemailer-mailgun-transport.

So, if gulp-mail accepts a transport object as an argument, users will have control over which transport they use.

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

3 participants