Skip to content

fix(mailer): include SiteURL in notification template data#2532

Open
jeffreywescott wants to merge 1 commit into
supabase:masterfrom
jeffreywescott:fix/notification-templates-siteurl
Open

fix(mailer): include SiteURL in notification template data#2532
jeffreywescott wants to merge 1 commit into
supabase:masterfrom
jeffreywescott:fix/notification-templates-siteurl

Conversation

@jeffreywescott
Copy link
Copy Markdown

Summary

The seven notification mail builders (PasswordChanged, EmailChanged, PhoneChanged, IdentityLinked, IdentityUnlinked, MFAFactorEnrolled, MFAFactorUnenrolled) omitted SiteURL from their template data maps, so templates referencing {{ .SiteURL }} render an empty string at runtime. The standard mail builders (Invite, Confirmation, Recovery, MagicLink, EmailChange, Reauthentication) already include it, and checkDefaults in template.go already whitelists SiteURL for all template types — so this looks like an oversight from when notification templates were added, not an intentional restriction.

Closes #2468

Test plan

  • go build ./... passes
  • go test ./internal/mailer/templatemailer/... passes
  • gofmt clean

The seven notification mail builders (PasswordChanged, EmailChanged,
PhoneChanged, IdentityLinked, IdentityUnlinked, MFAFactorEnrolled,
MFAFactorUnenrolled) omitted SiteURL from their template data maps,
so templates referencing {{ .SiteURL }} rendered an empty string at
runtime. The standard mail builders (Invite, Confirmation, Recovery,
MagicLink, EmailChange, Reauthentication) already include it, and
checkDefaults whitelists SiteURL for all template types, so this was
an oversight rather than an intentional restriction.

Closes supabase#2468
@jeffreywescott jeffreywescott requested a review from a team as a code owner May 15, 2026 17:13
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.

Go lang variables such as {{.SiteUrl}} not being gobally exposed to all email templates

1 participant