adamant-refrigerator-93887
05/31/2024, 10:48 AMchilly-king-10285
05/31/2024, 10:48 AMchilly-king-10285
05/31/2024, 10:49 AMemail.body.gotmpl
file is used to generate the body of the account recovery email sent to the user. The {{ .RecoveryCode }}
part is a placeholder that gets replaced with the actual recovery code generated for the user. When a user initiates the account recovery process, Ory Kratos generates a recovery code and sends an email to the user's registered email address. The email is generated using the templates defined in your email.body.gotmpl
file. In your case, the email body will contain the text "please recover access to your account by entering the following code:" followed by the actual recovery code. The user can then use this code to recover their account. Please note that the email.body.gotmpl
file is part of a set of templates used for email generation. You should also have email.subject.gotmpl
and email.body.plaintext.gotmpl
files for the email subject and a plaintext version of the email body, respectively. For more information on how to customize these templates, you can refer to the [Ory Kratos documentation](https://www.ory.sh/docs/kratos/emails-sms/custom-email-templates#mandatory-template-formats).adamant-refrigerator-93887
05/31/2024, 10:51 AMchilly-king-10285
05/31/2024, 10:51 AMchilly-king-10285
05/31/2024, 10:52 AMemail.body.gotmpl
file and they're not reflected in the emails sent by Ory Kratos, there could be a few reasons for this: 1. Caching: Ory Kratos might be using a cached version of the templates. Try restarting your Ory Kratos instance to clear any caches. 2. Incorrect file location: Ensure that the email.body.gotmpl
file is located in the correct directory. When self-hosting Ory Kratos, the system expects the templates at these paths: - <kratos-root>/<template-root>/recovery/valid
- <kratos-root>/<template-root>/recovery/invalid
- <kratos-root>/<template-root>/verification/valid
- <kratos-root>/<template-root>/verification/invalid
3. Configuration issues: Check your Ory Kratos configuration to ensure that it's correctly set up to use your custom templates. In your config.yml
file, you should have something like this: courier: template_override_path: /conf/courier-template # ... templates: verification: valid: email: body: html: <https://some-remote-resource/gotmpl> plaintext: <base64://SGV5IHlvdSBkZWNvZGVkIG1lIDop> # optionally, define the subject subject: <file://some-file/subject.gotmpl>
The template_override_path
should point to the directory containing your custom templates. If you've checked all of these and the issue persists, there might be a problem with your Ory Kratos setup. In that case, you might want to refer to the [Ory Kratos documentation](https://www.ory.sh/docs/kratos/self-hosted/mail-courier-templates#configuration) or seek help from the Ory community.adamant-refrigerator-93887
05/31/2024, 11:06 AMchilly-king-10285
05/31/2024, 11:06 AMchilly-king-10285
05/31/2024, 11:07 AMconfig.yml
file, you should have something like this: courier: smtp: connection_uri: <smtps://username:password@smtp-server:1234/> from_name: MyProject via Ory templates: recovery: invalid: email: body: html: "<base64://ENCODED_HTML_TEMPLATE>" plaintext: "<base64://ENCODED_PLAINTEXT_TEMPLATE>" valid: email: body: {}
The connection_uri
should point to your SMTP server, and the html
and plaintext
fields under body
should contain your base64 encoded templates. If you've checked all of these and the issue persists, there might be a problem with your Ory Kratos setup. In that case, you might want to refer to the [Ory Kratos documentation](https://www.ory.sh/docs/kratos/emails-sms/custom-email-templates#using-custom-message-templates) or seek help from the Ory community.adamant-refrigerator-93887
05/31/2024, 11:22 AMchilly-king-10285
05/31/2024, 11:22 AMchilly-king-10285
05/31/2024, 11:22 AMtest
) and password (test
) are correct for your SMTP server. 2. SMTP Server: Ensure that mailslurper
is the correct hostname for your SMTP server. 3. Port: Check that 1025
is the correct port for your SMTP server. 4. SSL Verification: You've added skip_ssl_verify=true
to the connection URI, which means SSL certificate verification is skipped. This is generally not recommended unless you're sure about the security of your SMTP server. If you've checked all of these and the issue persists, there might be a problem with your SMTP server or network. You might want to test the connection to your SMTP server outside of Ory Kratos to see if it's working correctly.