Package version
10.2.0
Describe the bug
I've been puzzled yesterday because I couldn't find any trace of my List-Unsubscribe headers in the email I received in Gmail.
Looking at the code for the resend transport, it doesn't look like it sets the headers object on the payload, which could explain why I couldn't find any trace of my headers in the received email.
Resend docs: https://resend.com/docs/api-reference/emails/send-email#param-headers
Mail code in question:
|
#preparePayload(mail: MailMessage) { |
my code:
// In mail class prepare() body
const postUnsubscribeUrl = signedUrlFor(
'newsletter.unsubscribe',
{ lang: locale },
{ expiresIn: '90 days', qs: { delivery: delivery.publicId }, prefixUrl: HOST }
)
this.message
.to(contact.email)
.htmlView(this.getViewPath('html'), payload)
.textView(this.getViewPath('text'), payload)
.listUnsubscribe(postUnsubscribeUrl)
.addListHeader('unsubscribe-post', 'List-Unsubscribe=One-Click')
// Code for sending the mail class instance
const letter = await makeMail(delivery)
const config = makeResendConfig({
category: 'marketing_campaign',
contactId: delivery.contactId,
campaignId: delivery.campaignId,
deliveryId: delivery.id,
})
try {
await providerLimiter.resend.schedule(async () => {
await mail.send(letter, config)
})
await markDeliveryAccepted(deliveryId)
} catch (error: unknown) {
await markDeliveryAppFailed(deliveryId, error)
throw error
}
Reproduction repo
No response
Package version
10.2.0
Describe the bug
I've been puzzled yesterday because I couldn't find any trace of my List-Unsubscribe headers in the email I received in Gmail.
Looking at the code for the resend transport, it doesn't look like it sets the headers object on the payload, which could explain why I couldn't find any trace of my headers in the received email.
Resend docs: https://resend.com/docs/api-reference/emails/send-email#param-headers
Mail code in question:
mail/src/transports/resend.ts
Line 88 in 92f7f2c
my code:
Reproduction repo
No response