Skip to content

Commit

Permalink
Merge pull request meanjs#259 from mindmelting/bug/fix_nodemailer_ins…
Browse files Browse the repository at this point in the history
…tance

Abstract nodemailer createTransport
  • Loading branch information
amoshaviv committed Nov 26, 2014
2 parents 5764270 + d5cf18a commit 6783ba5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/controllers/users/users.password.server.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ var _ = require('lodash'),
nodemailer = require('nodemailer'),
async = require('async'),
crypto = require('crypto');

var smtpTransport = nodemailer.createTransport(config.mailer.options);

/**
* Forgot for reset password (forgot POST)
Expand Down Expand Up @@ -65,7 +67,6 @@ exports.forgot = function(req, res, next) {
},
// If valid email, send reset email using service
function(emailHTML, user, done) {
var smtpTransport = nodemailer.createTransport(config.mailer.options);
var mailOptions = {
to: user.email,
from: config.mailer.from,
Expand Down Expand Up @@ -167,7 +168,6 @@ exports.reset = function(req, res, next) {
},
// If valid email, send reset email using service
function(emailHTML, user, done) {
var smtpTransport = nodemailer.createTransport(config.mailer.options);
var mailOptions = {
to: user.email,
from: config.mailer.from,
Expand Down Expand Up @@ -242,4 +242,4 @@ exports.changePassword = function(req, res) {
message: 'User is not signed in'
});
}
};
};

0 comments on commit 6783ba5

Please sign in to comment.