resend / resend-examples

Resend examples
https://resend.com/docs
MIT License
70 stars 5 forks source link

Content-Type header throwing error #154

Closed murphywrites closed 22 hours ago

murphywrites commented 2 months ago

When viewing the example with iCal attachment here:

...with-ical/src/pages/api/send.ts

line 21 shows the Content-Type header being set:

image

However, when I run I am getting an error saying { data: null, error: { statusCode: 500, message: "Duplicate header 'Content-Type'.", name: 'application_error' } } Any reason that might be? Sending without specifying this Content-Type header is related to this issue, I believe: https://github.com/resend/resend-node/issues/198

tscans commented 1 month ago

This has been a blocker for us using Resend. Have yet to find a way around it.

vcapretz commented 22 hours ago

hey there, we've updated our examples and made a few improvements on how we handle the specific content-type.

as you can see here: https://github.com/resend/resend-examples/blob/main/with-ical/src/pages/api/send.ts#L39 it should be sent in the attachments array instead of "globally" in the email headers, this should correctly make all email clients to render the iCal attachment correctly!

closing this issue but feel free to reopen or ping if you still see any issues 👍