Add Dark Mode, Password Hashing for better security , Settings Page, Policy PDF in Policy section,UI Changes

This commit is contained in:
arav
2026-01-10 19:39:40 +05:30
parent 933c0741ab
commit 9b605279e6
35 changed files with 1344 additions and 659 deletions

View File

@@ -1,9 +1,17 @@
import nodeMailer from 'nodemailer';
export default async function sendMail({ emailId, link, type, status, designation }) {
if (!process.env.TravelPolicyEmail || !process.env.TravelPolicyEmailPass) {
return;
}
export default async function sendMail({
emailId,
link,
type,
status,
designation,
}) {
// Check if we have email password in env
if (!process.env.TravelPolicyEmail || !process.env.TravelPolicyEmailPass) {
console.log("No email password found in .env, so I can't send emails.");
return;
}
console.log("parametrs", emailId, link, type, status, designation);
@@ -48,20 +56,20 @@ export default async function sendMail({ emailId, link, type, status, designatio
<a href=${link}>View Application</a>
<p>Thank you.</p>
`,
};
break;
case 'accounts':
mailOptions = {
from: process.env.TravelPolicyEmail,
to: emailId,
subject: 'Transfer money to the applicant',
html: `
<p>Please transfer the travel policy amount to the applicant's account. Click on the link below to view the application:</p>`
}
break;
default:
throw new Error('Invalid email type');
}
};
break;
case "accounts":
mailOptions = {
from: process.env.TravelPolicyEmail,
to: emailId,
subject: "Transfer money to the applicant",
html: `
<p>Please transfer the travel policy amount to the applicant's account. Click on the link below to view the application:</p>`,
};
break;
default:
throw new Error("Invalid email type");
}
try {
await transporter.sendMail(mailOptions);