Update index.js

This commit is contained in:
nguyentrungthat 2025-12-04 08:06:17 +07:00
parent 82e73c5670
commit 53e5de472c
1 changed files with 10 additions and 7 deletions

View File

@ -272,17 +272,20 @@ async function sendMail(subject, body) {
tls: { servername: process.env.MAIL_HOST }, tls: { servername: process.env.MAIL_HOST },
}); });
// add link to google drive in email body
const bodyEmail = `\nYou can see the Excel file from Google Drive.\n${`https://docs.google.com/spreadsheets/d/${process.env.GOOGLE_DRIVE_FILE_ID}/view`}\n\n\n${body}`;
const mailOptions = { const mailOptions = {
from: process.env.MAIL_USERNAME, from: process.env.MAIL_USERNAME,
to: EMAILS.join(","), to: EMAILS.join(","),
subject, subject,
text: body, text: bodyEmail,
attachments: [ // attachments: [
{ // {
filename: fileName, // filename: fileName,
content: response.data, // attach from memory // content: response.data, // attach from memory
}, // },
], // ],
}; };
await transporter.sendMail(mailOptions); await transporter.sendMail(mailOptions);