How to customize email subject by language in Auth email templates?

I'm using Supabase Auth email templates with multi-language support (German/English). I can customize the email body using Auth Hooks to pass language-specific content but the subject line in Dashboard → Authentication → Email Templates only accepts a single static value. Is there a way to dynamically set the email subject based on user language? I used the blog below as a reference and I wonder if it is possible for the email's subject? https://supabase.com/docs/guides/troubleshooting/customizing-emails-by-language-KZ_38Q
Supabase Docs | Troubleshooting | Customizing Emails by Language
Supabase is the Postgres development platform providing all the backend features you need to build a product.
No description
3 Replies
silentworks
silentworks5d ago
The subject line seems to take variables but not sure if conditionals work there. You might have to test it to see if it works.
mili is my name
mili is my nameOP5d ago
@silentworks thank u for ur response! i did! it always falls back to the else... the content body works fine tho!
{{if eq .Data.language "de"}}Bestätigen Sie Ihr Packsil-Konto{{else}}Confirm your Packsil account{{end}}
{{if eq .Data.language "de"}}Bestätigen Sie Ihr Packsil-Konto{{else}}Confirm your Packsil account{{end}}
silentworks
silentworks5d ago
I would expect it to outright fail if it wasn't working. Maybe just output the {{ .Data.language }} in the subject along with some text and see what it outputs.

Did you find this page helpful?