fix(email): allow sender email var for development
Allows setting the SES_ID, SES_SECRET and EMAIL_SENDER values
This commit is contained in:
committed by
Berkeley Martinez
parent
0ce30409c0
commit
a426ff7ef9
@ -597,20 +597,23 @@ module.exports = function(User) {
|
|||||||
const mailOptions = {
|
const mailOptions = {
|
||||||
type: 'email',
|
type: 'email',
|
||||||
to: user.email,
|
to: user.email,
|
||||||
|
<<<<<<< HEAD
|
||||||
from: 'Team@freecodecamp.com',
|
from: 'Team@freecodecamp.com',
|
||||||
subject: 'Free Code Camp - Authentication Request!',
|
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({
|
text: renderAuthEmail({
|
||||||
loginEmail,
|
loginEmail,
|
||||||
loginToken
|
loginToken
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
if (!isDev) {
|
|
||||||
this.email.send(mailOptions, err =>{
|
this.email.send(mailOptions, err =>{
|
||||||
if (err) { throw err; }
|
if (err) { throw err; }
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
console.log('~~~~\n' + mailOptions.text + '~~~~\n');
|
|
||||||
}
|
|
||||||
const emailAuthLinkTTL = token.created;
|
const emailAuthLinkTTL = token.created;
|
||||||
this.update$({
|
this.update$({
|
||||||
emailAuthLinkTTL
|
emailAuthLinkTTL
|
||||||
|
Reference in New Issue
Block a user