From 16c5ce82c7fd8241a1b8ba4d4c1ebf3ccd092f32 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Wed, 8 Apr 2026 12:04:36 +0200 Subject: [PATCH] Add `List-Unsubscribe` header to emails for improved unsubscribe management --- backend/email/emails/functions/send-email.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/backend/email/emails/functions/send-email.ts b/backend/email/emails/functions/send-email.ts index ee8b7022..20854191 100644 --- a/backend/email/emails/functions/send-email.ts +++ b/backend/email/emails/functions/send-email.ts @@ -1,5 +1,6 @@ import {IS_LOCAL} from 'common/hosting/constants' import {debug} from 'common/logger' +import {UNSUBSCRIBE_URL} from 'common/user-notification-preferences' import {sleep} from 'common/util/time' import {type CreateEmailOptions, CreateEmailRequestOptions, Resend} from 'resend' import {log} from 'shared/utils' @@ -23,7 +24,13 @@ export const sendEmail = async ( if (!resend) return null const {data, error} = await resend.emails.send( - {replyTo: 'Compass ', ...payload}, + { + replyTo: 'Compass ', + headers: { + 'List-Unsubscribe': UNSUBSCRIBE_URL, + }, + ...payload, + }, options, ) debug('resend.emails.send', data, error)