supabase / auth

A JWT based API for managing users and issuing JWT tokens
https://supabase.com/docs/guides/auth
MIT License
1.55k stars 375 forks source link

feat: add mail header support via `GOTRUE_SMTP_HEADERS` with `$messageType` #1804

Closed hf closed 1 month ago

hf commented 1 month ago

Adds support for additional and configurable email message headers. Set the GOTRUE_SMTP_HEADERS value to a JSON object of the shape (TypeScript notation)

{ [header: string]: string[] }

Use the special string $messageType in the value portion to identify the message type being sent (for now: invite, confirm, reauthenticate, email_change, recovery, magiclink, other).

To use this with AWS SES Feedback-ID one way to do it would be to set SES SMTP message tags:

GOTRUE_SMTP_HEADERS={"x-ses-message-tags": ["ses:feedback-id-a=<project-ref>,ses:feedback-id-b=$messageType"]}
coveralls commented 1 month ago

Pull Request Test Coverage Report for Build 11332733424

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/conf/configuration.go 16 18 88.89%
internal/mailer/template.go 27 30 90.0%
internal/mailer/mailme.go 0 6 0.0%
<!-- Total: 44 55 80.0% -->
Totals Coverage Status
Change from base Build 11327229130: 0.07%
Covered Lines: 9544
Relevant Lines: 16678

💛 - Coveralls