Skip to content

feat(email): carry custom headers through to SES - #14

Merged
Bccorb merged 1 commit into
mainfrom
feat/email-headers
Oct 31, 2026
Merged

Bccorb merged 1 commit into
mainfrom
feat/email-headers

Conversation

@Bccorb

@Bccorb Bccorb commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Adds an optional headers map to EmailMessage, so an adopter can send List-Unsubscribe and List-Unsubscribe-Post for one-click unsubscribe.

  • Header names must be RFC 5322 field names, values must be one non-empty line, and From, To, Cc, Bcc, Subject and Content-Type are refused because the transport sets them from the message.
  • The AWS email transport moves from @aws-sdk/client-ses to @aws-sdk/client-sesv2, because the v1 SendEmail call cannot carry custom headers. Simple content is still authorised by ses:SendEmail, so no IAM change is needed.
  • A sesClient passed in config must now accept the v2 SendEmailCommand. Called out in the changeset (minor bump on the fixed group).

npm run release:verify: lint, format, typecheck and 12 tests pass.

Email messages take an optional headers map, validated against header
injection and against names the transport sets itself. The AWS transport
moves to SES v2, whose SendEmail call can carry custom headers; the IAM
action is unchanged.
@Bccorb
Bccorb merged commit 75a1ffa into main Oct 31, 2026
3 checks passed
@Bccorb
Bccorb deleted the feat/email-headers branch October 31, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant