resend/resend-examples

Content-Type header throwing error

Closed this issue · 2 comments

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: resend/resend-node#198

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

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 👍