kratos: Kratos courier: can't evaluate field Identity
Preflight checklist
- I could not find a solution in the existing issues, docs, nor discussions.
- I agree to follow this project’s Code of Conduct.
- I have read and am following this repository’s Contribution Guidelines.
- This issue affects my Ory Cloud project.
- I have joined the Ory Community Slack.
- I am signed up to the Ory Security Patch Newsletter.
Describe the bug
I am trying to use Identity in email templates, according to documentation https://www.ory.sh/kratos/docs/concepts/email-sms/#the-identity-attribute.
If I use .Identity in template, process breaks.

Reproducing the bug
- Run Kratos without courier.
- Run standalone courier.
- Mount templates to both Kratos and Courier and use
.Identity. - Send email.
Relevant log output
time=2021-11-17T21:11:17Z level=error msg=Unable to get email body from template. audience=application error=map[message:template: verification/valid/email.body.gotmpl:144:167: executing "verification/valid/email.body.gotmpl" at <.Identity.traits.name.first>: can't evaluate field Identity in type *template.VerificationValidModel] message_id=bfa3fcf7-3130-4a0b-861f-3f2168bb9d6e service_name=Ory Kratos service_version=v0.8.0-alpha.3
time=2021-11-17T21:15:46Z level=error msg=Unable to get email body from template. audience=application error=map[message:template: recovery/valid/email.body.gotmpl:144:167: executing "recovery/valid/email.body.gotmpl" at <.Identity.traits.name.first>: can't evaluate field Identity in type *template.RecoveryValidModel] message_id=f59ae8a4-5738-4069-a808-07a7f91ece27 service_name=Ory Kratos service_version=v0.8.0-alpha.3
Relevant configuration
No response
Version
v0.8.0-alpha.3
On which operating system are you observing this issue?
Linux
In which environment are you deploying?
Kubernetes
Additional Context
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (11 by maintainers)
Commits related to this issue
- Update email-sms.md docs (#1960) Add information about providing templates while using courier as separate job — committed to viters/kratos by deleted user 3 years ago
- docs: update email template docs (#1960) — committed to viters/kratos by deleted user 3 years ago
- docs: update email template docs (#1960) (#1968) — committed to ory/kratos by deleted user 3 years ago
- docs: update email template docs (#1960) (#1968) — committed to senteca/kratos-fork by deleted user 3 years ago
Accepting PRs 😃
Interesting find! Bugfixes welcomed 😃
Isn’t this done automatically for our helm charts?