sendgrid-nodejs
sendgrid-nodejs copied to clipboard
Attachment filename gets appended with a random number
Issue Summary
Sending an attachment messes up the filename the user finally gets to see.
Steps to Reproduce
- Add the code as below
- Send the attachment via code
Code Snippet
if (message.guideAttachment) {
const guideAttachment = await getFileFromBlobStorage(
message.guideAttachment.fileName
);
const emailGuideAttachment = {
content: guideAttachment,
filename: "Welcome_to_DL78.pdf",
type: message.guideAttachment.type as FileTypes,
disposition: 'attachment',
};
if (!email.attachments) email.attachments = [emailGuideAttachment];
else email.attachments.push(emailGuideAttachment);
}
console.log(email);
await sgMail.send(email);
}
Exception/Log
The attachment filename is appended with random looking number [98] other times I get [58]
Technical details:
- sendgrid-nodejs version: "^7.4.5"
- node version: v14.16.0