few-oyster-74399
07/10/2024, 1:30 PMchilly-king-10285
07/10/2024, 1:30 PMchilly-king-10285
07/10/2024, 1:30 PMemail.subject.gotmpl
, email.body.gotmpl
and email.body.plaintext.gotmpl
templates based on user settings, such as their chosen language. To enable this, you need to customize the identity schema to include the user's preferred communication language. This identity trait can then be used inside the template to render a section conditionally. Here is an example of a custom Identity Schema with user language: json { // ... "properties": { "traits": { "type": "object", "properties": { // ... "lang": { "type": "string", "title": "Your preferred language" }, "required": [ "email" ], "additionalProperties": false, } } }
You can then use this lang
trait in your templates to render different versions based on the user's preferred language. For more details, you can refer to the [Ory documentation](https://www.ory.sh/docs/kratos/emails-sms/custom-email-templates#translated-templates-i18n).