forked from strongloop/loopback
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support 'alias' in mail transport config.
Useful if you need to set up multiple transports of the same type. [forward-port of strongloop#2489]
- Loading branch information
Showing
2 changed files
with
13 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,10 +60,11 @@ MailConnector.prototype.DataAccessObject = Mailer; | |
* Example: | ||
* | ||
* Email.setupTransport({ | ||
* type: 'SMTP', | ||
* type: "SMTP", | ||
* host: "smtp.gmail.com", // hostname | ||
* secureConnection: true, // use SSL | ||
* port: 465, // port for secure SMTP | ||
* alias: "gmail", // optional alias for use with 'transport' option when sending | ||
* auth: { | ||
* user: "gmail.user@gmail.com", | ||
* pass: "userpass" | ||
|
@@ -89,7 +90,7 @@ MailConnector.prototype.setupTransport = function(setting) { | |
transport = mailer.createTransport(transportModule(setting)); | ||
} | ||
|
||
connector.transportsIndex[setting.type] = transport; | ||
connector.transportsIndex[setting.alias || setting.type] = transport; | ||
connector.transports.push(transport); | ||
}; | ||
|
||
|
@@ -128,7 +129,8 @@ MailConnector.prototype.defaultTransport = function() { | |
* to: "[email protected], [email protected]", // list of receivers | ||
* subject: "Hello ✔", // Subject line | ||
* text: "Hello world ✔", // plaintext body | ||
* html: "<b>Hello world ✔</b>" // html body | ||
* html: "<b>Hello world ✔</b>", // html body | ||
* transport: "gmail", // See 'alias' option above in setupTransport | ||
* } | ||
* | ||
* See https://github.com/andris9/Nodemailer for other supported options. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters