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 },
|
||||
});
|
||||
|
||||
// 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 = {
|
||||
from: process.env.MAIL_USERNAME,
|
||||
to: EMAILS.join(","),
|
||||
subject,
|
||||
text: body,
|
||||
attachments: [
|
||||
{
|
||||
filename: fileName,
|
||||
content: response.data, // attach from memory
|
||||
},
|
||||
],
|
||||
text: bodyEmail,
|
||||
// attachments: [
|
||||
// {
|
||||
// filename: fileName,
|
||||
// content: response.data, // attach from memory
|
||||
// },
|
||||
// ],
|
||||
};
|
||||
|
||||
await transporter.sendMail(mailOptions);
|
||||
|
|
|
|||
Loading…
Reference in New Issue