added the ability to use an array of transports or just a single trnasport
This commit is contained in:
parent
d82d789ffa
commit
56fe548a46
|
@ -19,9 +19,9 @@ module.exports = MailConnector;
|
||||||
|
|
||||||
function MailConnector(settings) {
|
function MailConnector(settings) {
|
||||||
assert(typeof settings === 'object', 'cannot initialize MailConnector without a settings object');
|
assert(typeof settings === 'object', 'cannot initialize MailConnector without a settings object');
|
||||||
var transports = settings.transports || [];
|
var transports = settings.transports || [settings.transport] || [];
|
||||||
this.transportsIndex = {};
|
this.transportsIndex = {};
|
||||||
this.transports = [];
|
this.transports = [];
|
||||||
|
|
||||||
if(loopback.isServer) {
|
if(loopback.isServer) {
|
||||||
transports.forEach(this.setupTransport.bind(this));
|
transports.forEach(this.setupTransport.bind(this));
|
||||||
|
|
Loading…
Reference in New Issue