浏览代码

be consistent with from field in emails

Florian Ludwig 6 年之前
父节点
当前提交
f2b4fa9358
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      server/controllers/authController.js
  2. 1 1
      server/controllers/urlController.js

+ 1 - 1
server/controllers/authController.js

@@ -182,7 +182,7 @@ exports.requestPasswordReset = async ({ body: { email } }, res) => {
     return res.status(400).json({ error: "Couldn't reset password." });
   }
   const mail = await transporter.sendMail({
-    from: process.env.MAIL_USER,
+    from: process.env.MAIL_FROM || process.env.MAIL_USER,
     to: user.email,
     subject: 'Reset your password',
     text: resetMailText

+ 1 - 1
server/controllers/urlController.js

@@ -314,7 +314,7 @@ exports.reportUrl = async ({ body: { url } }, res) => {
   if (!isValidUrl) return res.status(400).json({ error: 'URL is not valid.' });
 
   const mail = await transporter.sendMail({
-    from: process.env.MAIL_USER,
+    from: process.env.MAIL_FROM || process.env.MAIL_USER,
     to: process.env.REPORT_MAIL,
     subject: '[REPORT]',
     text: url,