hundreds-city-19796
09/19/2025, 10:42 AMchilly-king-10285
09/19/2025, 10:42 AMchilly-king-10285
09/19/2025, 10:42 AM.Identity.traits.lang
or .Identity.metadata_public.lang
within the template logic [Customizing template content for specific users](https://www.ory.sh/docs/kratos/emails-sms/custom-email-templates#customizing-template-content-for-specific-users). There is no documented way to automatically detect the user's browser language (e.g., via the Accept-Language header) and pass that to the email template system at the time of sending. The email system does not natively receive or process browser headers; it relies on the data present in the identity object or, optionally, in a transient payload if you are triggering flows programmatically and can inject such data [Transient payload in templates](https://www.ory.sh/docs/kratos/emails-sms/custom-email-templates#transient-payload-in-templates). If you control the flow initiation (for example, via a custom frontend), you could theoretically pass the detected browser language as a transient payload when starting a self-service flow, and then reference that in your email template using {{index .TransientPayload "lang"}}
. However, this is not the default or recommended approach, and the documentation does not provide a full end-to-end example for this use case. Summary: - The standard and supported way is to store the language in the identity traits or metadata. - There is no built-in support for passing the browser's language directly to the email template system. - Using transient payloads is a possible workaround if you can inject the language at flow initiation, but this is not explicitly documented as a best practice. If you need this feature, you may want to consider submitting a feature request or reaching out to the Ory team for further guidance, as the current documentation does not cover this scenario in detail.