Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attachment filename gets appended with a random number #1358

Open
kmarrip opened this issue Apr 20, 2022 · 0 comments
Open

Attachment filename gets appended with a random number #1358

kmarrip opened this issue Apr 20, 2022 · 0 comments

Comments

@kmarrip
Copy link

kmarrip commented Apr 20, 2022

Issue Summary

Sending an attachment messes up the filename the user finally gets to see.

Steps to Reproduce

  1. Add the code as below
  2. 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

image
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant