Skip to content

Conversation

LetItRock
Copy link
Contributor

What changed? Why was the change needed?

Fix failing email CID image attachments. I'll describe a couple of issues in the comments.

Screenshots

Screenshot 2025-10-08 at 23 55 48 Screenshot 2025-10-08 at 23 56 06 Screenshot 2025-10-08 at 23 55 41

@LetItRock LetItRock self-assigned this Oct 8, 2025
@linear
Copy link

linear bot commented Oct 8, 2025

@netlify
Copy link

netlify bot commented Oct 8, 2025

Deploy Preview for dashboard-v2-novu-staging canceled.

Name Link
🔨 Latest commit 849bd41
🔍 Latest deploy log https://app.netlify.com/projects/dashboard-v2-novu-staging/deploys/68e774af9d6b6e0008c8b464

@github-actions github-actions bot changed the title fix(worker,framework): email cid images fix(worker,framework): email cid images fixes NV-6777 Oct 8, 2025
Comment on lines +315 to +316
cid: attachment.cid,
disposition: attachment.disposition,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the attachments cid, disposition was missing when passing this information to the providers :/

* Additional URL schemes to allow in src, href, and other URL attributes.
* Including 'cid:' for Content-ID references used in email attachments.
*/
allowedSchemes: sanitizeTypes.defaults.allowedSchemes.concat(['cid']),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the <img src="cid:..." cid schema was not allowed during sanitization :/

return JSON.parse(compiledString);
// repair the string to fix invalid JSON, it could happen in the case when the control value
// has the escaped quotes like '\"foo\"' then compiled string is not valid JSON and parse will fail
const repairedString = jsonrepair(compiledString);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comment above explains the case well

attachments: options.attachments?.map((attachment) => ({
filename: attachment?.name,
content: attachment.file,
contentId: attachment.cid,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing in resend

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 8, 2025

Open in StackBlitz

npm i https://pkg.pr.new/novuhq/novu/@novu/framework@9330
npm i https://pkg.pr.new/novuhq/novu@9330
npm i https://pkg.pr.new/novuhq/novu/@novu/providers@9330

commit: 849bd41

@LetItRock LetItRock merged commit b7c7868 into next Oct 9, 2025
69 of 73 checks passed
@LetItRock LetItRock deleted the nv-6777-fix-email-cid-images branch October 9, 2025 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant