Skip to content

Attachment filename gets appended with a random number #1358

Open
@kmarrip

Description

@kmarrip

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions