sendgrid-nodejs
sendgrid-nodejs copied to clipboard
fix: Changed contentId to content_id for correct type
Fixes
In order for the 'Content-ID' header to be set for the attachment, the parameter 'content_id' has to be set. 'contentId' isn't registered as the header, and the header is not provided in the email. The only workaround is to not use types, which defeats the purpose.
This should fix the type
Checklist
- [x] I acknowledge that all my contributions will be made under the project's license
- [x] I have made a material change to the repo (functionality, testing, spelling, grammar)
- [x] I have read the Contribution Guidelines and my PR follows them
- [x] I have titled the PR appropriately
- [x] I have updated my branch with the main branch
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added the necessary documentation about the functionality in the appropriate .md file
- [ ] I have added inline documentation to the code I modified
If you have questions, please file a support ticket.
Please merge.
omg, really...
if anyone needs a hand...
import { AttachmentData } from "@sendgrid/helpers/classes/attachment";
attachments: <(AttachmentData & { content_id: string })[]>[{
disposition: 'inline',
filename: 'image.jpg',
content: base64Content,
content_id: "inlineimage",
type: 'image/jpeg'
}]
Wow I just spent a good chunk of time trying to figure out why SendGrid wasn't setting the Content-ID
header. This really should be merged ASAP @twilio-dx
@SendGridDX: can we merge this. It's insane that the field is misnamed in the official node package.