We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe5baaa commit 94d9eceCopy full SHA for 94d9ece
server/Controllers/LeaveController.js
@@ -59,14 +59,15 @@ const LeaveController = {
59
from: process.env.EMAIL_USER,
60
to: hodEmail,
61
subject: "Notifications from ERP",
62
- text: "There is a new Leave to Approve from" + reqEmail,
+ text: "There is a new Leave to Approve from : " + Emailid,
63
};
64
try {
65
await transporter.sendMail(mailOptions);
66
- const email = new Email({ to, subject, body });
+ const email = new Email({ to:hodEmail, subject:mailOptions.subject, body:mailOptions.text });
67
await email.save();
68
return res.json({ Status: "Success"})
69
} catch (error) {
70
+ console.log(error)
71
return res.json({ Error: "Error While Sending Emails"})
72
}
73
0 commit comments