Open till opened 7 months ago
It seems like the --set-file
for the schema is a special case, the emails work like this:
--set-file kratos.emailTemplates.recovery.valid.body=kratos/emails/recovery.html
--set-file kratos.emailTemplates.recovery.valid.plainBody=kratos/emails/recovery.txt
--set-file kratos.emailTemplates.recovery.invalid.body=kratos/emails/recovery-invalid.html
--set-file kratos.emailTemplates.recovery.invalid.plainBody=kratos/emails/recovery-invalid.txt
--set-file kratos.emailTemplates.verification.valid.body=kratos/emails/verification.html
--set-file kratos.emailTemplates.verification.valid.plainBody=kratos/emails/verification.txt
--set-file kratos.emailTemplates.verification.invalid.body=kratos/emails/verification-invalid.html
--set-file kratos.emailTemplates.verification.invalid.plainBody=kratos/emails/verification-invalid.txt
At least that renders the ConfigMap
resources correctly. But kratos still doesn't use "new" these emails.
So, the last bit was missing:
kratos:
config:
courier:
template_override_path: /conf/courier-templates
I think the first bit could probably be docs?
The one remaining problem is that the config mentions the following templates:
Is there more? Because I just tried a verification flow and the email includes a code?
Maybe this could be added to the values file: https://github.com/ory/kratos/tree/master/courier/template/courier/builtin/templates
Following the naming of the directories, you can set any other template, e.g.:
--set-file kratos.emailTemplates.verification_code.valid.body=kratos/emails/verification_code.html
--set-file kratos.emailTemplates.verification_code.valid.plainBody=kratos/emails/verification_code.txt
--set-file kratos.emailTemplates.verification_code.invalid.body=kratos/emails/verification-invalid.html
--set-file kratos.emailTemplates.verification_code.invalid.plainBody=kratos/emails/verification-invalid.txt
Hi there! The configmap implementation for the templates is quite flexible and simply traverses through the config using a for-each structure. Do you think this is a documentation issue, and we should reword it to make it clear that the examples in values.yaml and the docs are just examples and not all fields that can be set using this mechanism?
Yeah, another example and maybe a link to kratos source would be sufficient IMHO.
Preflight checklist
Ory Network Project
No response
Describe the bug
I am trying to customize the email templates using external files as the values file from your helm chart gets longer and longer, and longer.
So far, I only get a config map rendered that contains the values from the file though, e.g.
{{.Values.email_recovery}}
but I expected to see the values of the files I inject with--set-file
.Reproducing the bug
I tried it with:
This renders a config map like:
Relevant log output
Relevant configuration
No response
Version
0.37.0
On which operating system are you observing this issue?
Linux
In which environment are you deploying?
Kubernetes with Helm
Additional Context
No response