Update index.js
This commit is contained in:
parent
82e73c5670
commit
53e5de472c
17
index.js
17
index.js
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue