Merge pull request #375 from strongloop/feature/upgrade-to-nodemailer-1.x

Upgrade to nodemailer 1.0.1
This commit is contained in:
Raymond Feng 2014-07-21 11:58:17 -07:00
commit 0dae813d5f
4 changed files with 13 additions and 6 deletions

View File

@ -58,7 +58,12 @@ MailConnector.prototype.setupTransport = function(setting) {
var connector = this;
connector.transports = connector.transports || [];
connector.transportsIndex = connector.transportsIndex || {};
var transport = mailer.createTransport(setting.type, setting);
var transportModuleName = 'nodemailer-' + (setting.type || 'STUB').toLowerCase() + '-transport';
var transportModule = require(transportModuleName);
var transport = mailer.createTransport(transportModule(setting));
connector.transportsIndex[setting.type] = transport;
connector.transports.push(transport);
}

View File

@ -40,7 +40,8 @@
"bcryptjs": "~2.0.1",
"debug": "~1.0.4",
"inflection": "~1.3.8",
"nodemailer": "~0.7.1",
"nodemailer": "~1.0.1",
"nodemailer-stub-transport": "~0.1.4",
"uid2": "0.0.3",
"underscore": "~1.6.0",
"underscore.string": "~2.3.3"

View File

@ -24,7 +24,8 @@ describe('Email and SMTP', function () {
};
MyEmail.send(options, function(err, mail) {
assert(mail.message);
assert(!err);
assert(mail.response);
assert(mail.envelope);
assert(mail.messageId);
done(err);
@ -41,7 +42,7 @@ describe('Email and SMTP', function () {
});
message.send(function (err, mail) {
assert(mail.message);
assert(mail.response);
assert(mail.envelope);
assert(mail.messageId);
done(err);

View File

@ -443,11 +443,11 @@ describe('User', function(){
user.verify(options, function (err, result) {
assert(result.email);
assert(result.email.message);
assert(result.email.response);
assert(result.token);
assert(~result.email.message.indexOf('To: bar@bat.com'));
assert(~result.email.response.toString('utf-8').indexOf('To: bar@bat.com'));
done();
});
});