fix(email): allow sender email var for development

Allows setting the SES_ID, SES_SECRET and EMAIL_SENDER values
This commit is contained in:
Mrugesh Mohapatra
2017-04-23 14:18:33 +05:30
committed by Berkeley Martinez
parent 0ce30409c0
commit a426ff7ef9

View File

@ -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