Skip to content

Commit 47388e4

Browse files
committed
Remove hardcoded email config for dev
1 parent eb99fc5 commit 47388e4

File tree

1 file changed

+9
-22
lines changed

1 file changed

+9
-22
lines changed

server/mail/mail.js

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,15 @@
11
const config = require('../config');
22
const nodemailer = require('nodemailer');
33

4-
let mailConfig = {};
5-
6-
if (process.env.NODE_ENV === 'production') {
7-
mailConfig = {
8-
host: config.MAIL_HOST,
9-
port: config.MAIL_PORT,
10-
secure: config.MAIL_SECURE,
11-
auth: {
12-
user: config.MAIL_USER,
13-
pass: config.MAIL_PASSWORD,
14-
},
15-
};
16-
} else {
17-
mailConfig = {
18-
host: 'smtp.ethereal.email',
19-
port: 587,
20-
auth: {
21-
22-
pass: 'fjmhsR8zJQZ3BKQath',
23-
},
24-
};
25-
}
4+
const mailConfig = {
5+
host: config.MAIL_HOST,
6+
port: config.MAIL_PORT,
7+
secure: config.MAIL_SECURE,
8+
auth: {
9+
user: config.MAIL_USER,
10+
pass: config.MAIL_PASSWORD,
11+
},
12+
};
2613

2714
const transporter = nodemailer.createTransport(mailConfig);
2815
module.exports = transporter;

0 commit comments

Comments
 (0)