From a426ff7ef94721b5bd710cddec4fa2c0e6b30a9f Mon Sep 17 00:00:00 2001 From: Mrugesh Mohapatra Date: Sun, 23 Apr 2017 14:18:33 +0530 Subject: [PATCH] fix(email): allow sender email var for development Allows setting the SES_ID, SES_SECRET and EMAIL_SENDER values --- common/models/user.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/common/models/user.js b/common/models/user.js index b92b766f74..b7a3ceb81a 100644 --- a/common/models/user.js +++ b/common/models/user.js @@ -597,20 +597,23 @@ module.exports = function(User) { const mailOptions = { type: 'email', to: user.email, +<<<<<<< HEAD from: 'Team@freecodecamp.com', subject: 'Free Code Camp - Authentication Request!', +======= + from: isDev ? + process.env.EMAIL_SENDER : 'team@freecodecamp.com', + subject: 'freeCodeCamp - Authentication Request!', +>>>>>>> fix(email): allow sender email var for development text: renderAuthEmail({ loginEmail, loginToken }) }; - if (!isDev) { - this.email.send(mailOptions, err =>{ - if (err) { throw err; } - }); - } else { - console.log('~~~~\n' + mailOptions.text + '~~~~\n'); - } + + this.email.send(mailOptions, err =>{ + if (err) { throw err; } + }); const emailAuthLinkTTL = token.created; this.update$({ emailAuthLinkTTL