Skip to content

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

Merged
cstockton merged 3 commits into
supabase:masterfrom
jeffreywescott:fix/notification-templates-siteurl
May 26, 2026
Merged

cstockton merged 3 commits into
supabase:masterfrom
jeffreywescott:fix/notification-templates-siteurl

Conversation

@jeffreywescott

Copy link
Copy Markdown
Contributor

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
@vonschappler

Copy link
Copy Markdown

@jeffreywescott - ty for hopping in... someone else has dropped in, but they were ignored - i just hope that the same does not happens with you, because i'm tired of "hacking" for things to work (and not all the hacks work as expected, and this is draining me up!)

@cstockton

Copy link
Copy Markdown
Contributor

@jeffreywescott @vonschappler Thanks for taking the time to point this out and apologies for the delay, I'll get this merged soon as the tests pass.

cstockton pushed a commit to supabase/supabase that referenced this pull request May 26, 2026
This will make email templates more consistent and may be merged
after supabase/auth#2532 is deployed.

@cstockton cstockton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good thank you!

@cstockton

Copy link
Copy Markdown
Contributor

This will be available to use inside templates immediately after the next auth release. However it will not show up in the dashboard template editor until supabase/supabase#46393 is merged, which must be done after the auth release.

@cstockton
cstockton merged commit dc015da into supabase:master May 26, 2026
3 checks passed
cstockton pushed a commit that referenced this pull request Jun 15, 2026
🤖 I have created a release *beep* *boop*
---


##
[2.190.0](v2.189.0...v2.190.0)
(2026-06-11)


### Features

* add -failfast to make test command
([#2553](#2553))
([bec1dd0](bec1dd0))
* **conf:** add JSON config file support
([#2540](#2540))
([e63fef9](e63fef9))
* create tools directory for deterministic builds
([#2522](#2522))
([52cf3d9](52cf3d9))
* **custom-oidc:** support non-standard discovery URLs
([#2573](#2573))
([3dacc64](3dacc64))
* fix the vulncheck-filter to parse the text format instead
([#2525](#2525))
([4136d49](4136d49))
* fork github.com/joho/godotenv into internal/conf/envparse
([#2521](#2521))
([cda62a9](cda62a9))


### Bug Fixes

* Azure issuer validation
([#2560](#2560))
([a39858b](a39858b))
* catch cancelation errors in bg workers & servers
([#2530](#2530))
([77f5918](77f5918))
* check session state for admin tokens
([#2555](#2555))
([c5969ed](c5969ed))
* **config:** warn on invalid WebAuthn config instead of erroring
([#2545](#2545))
([ca0b154](ca0b154))
* **custom-oidc:** strip trailing slashes from issuer
([#2570](#2570))
([169ad67](169ad67))
* **Dockerfile:** ensure forks exists on fs before make deps
([#2567](#2567))
([01f136d](01f136d))
* **mailer:** include SiteURL in notification template data
([#2532](#2532))
([dc015da](dc015da))
* **oauth-server:** serialize concurrent authorize/consent with
row-level lock ([#2512](#2512))
([c816cfe](c816cfe))
* **passkeys:** delete webauthn creds when user is soft-deleted
([#2564](#2564))
([7e1c060](7e1c060))
* **passkeys:** enforce AAL checks on passkey registration and deletion
([#2565](#2565))
([7e6f2e4](7e6f2e4))
* source WebAuthn RP config from env vars
([#2490](#2490))
([63949ca](63949ca))
* when version is empty set to 0.0.0
([#2531](#2531))
([a3b7c8c](a3b7c8c))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: supabase-releaser[bot] <223506987+supabase-releaser[bot]@users.noreply.github.com>
cstockton added a commit to supabase/supabase that referenced this pull request Jun 25, 2026
…6393)

This will make email templates more consistent and may be merged after
supabase/auth#2532 is deployed.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Authentication notification emails now include access to site URL
references. This enhancement applies to multiple notification types:
password change alerts, email change confirmations, phone number change
notifications, identity linking and unlinking events, and multi-factor
authentication enrollment and unenrollment notifications.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/46393?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Chris Stockton <[email protected]>
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

3 participants