Skip to content

fix(sms): support literal \n in SMS OTP templates#2438

Closed
ambujvashistha wants to merge 1 commit intosupabase:masterfrom
ambujvashistha:fix/sms-template-newlines
Closed

fix(sms): support literal \n in SMS OTP templates#2438
ambujvashistha wants to merge 1 commit intosupabase:masterfrom
ambujvashistha:fix/sms-template-newlines

Conversation

@ambujvashistha
Copy link

Fixes supabase/supabase#6435

Summary

Users want to use newlines (\n) in their SMS OTP templates configured via environment variables, but SMS providers were sending the literal string \n instead of an actual newline character.

This PR fixes the issue by replacing any literal \n sequences in the SMS template string with actual newline characters before parsing the Go template.

Changes

  • In internal/conf/configuration.go, added strings.ReplaceAll(template, "\\n", "\n") before parsing both Sms.Template and MFA.Phone.Template

@ambujvashistha ambujvashistha requested a review from a team as a code owner March 23, 2026 15:24
@ambujvashistha ambujvashistha closed this by deleting the head repository Mar 23, 2026
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.

Allow newlines in SMS OTP template

1 participant