Skip to content

Commit 94d9ece

Browse files
BackendExpertJehanKandyAnupa1998
committed
Update LeaveController.js
Co-Authored-By: JehanKandy <[email protected]> Co-Authored-By: Anupa Gamage <[email protected]>
1 parent fe5baaa commit 94d9ece

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

server/Controllers/LeaveController.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,15 @@ const LeaveController = {
5959
from: process.env.EMAIL_USER,
6060
to: hodEmail,
6161
subject: "Notifications from ERP",
62-
text: "There is a new Leave to Approve from" + reqEmail,
62+
text: "There is a new Leave to Approve from : " + Emailid,
6363
};
6464
try {
6565
await transporter.sendMail(mailOptions);
66-
const email = new Email({ to, subject, body });
66+
const email = new Email({ to:hodEmail, subject:mailOptions.subject, body:mailOptions.text });
6767
await email.save();
6868
return res.json({ Status: "Success"})
6969
} catch (error) {
70+
console.log(error)
7071
return res.json({ Error: "Error While Sending Emails"})
7172
}
7273

0 commit comments

Comments
 (0)