LarzousL
ZITADEL8mo ago
5 replies
Larzous

EmailTemplate - Default Only or direct DB available?

In the sourcecode you provide the raw HTML file that is used for email generation when the SMTP email is sent:
zitadel/internal/notification/static/templates
/template.html


From my reading of the documentation, in
defaults.yml
you provide
EmailTemplate:
which is a subsection of
DefaultInstance:
. Based on my investigation this is actually a base64 conversion of the html file above. -- As my instance is already setup and using
EmailTemplate
won't work for us have found that this file exists in hex format over in
zitadel.projections.mail_templates2
. There is only one instance with a hex entry in
template(bytea)
.
- I found this after reading the outdated DB Schema for "Notifications" - https://zitadel.com/docs/concepts/eventstore/implementation#schemas

I pipped the binary into
xxd -r -p > template_maybe.html
and after doing an sdiff it appears to be the same file.

QUESTION 1 - I know its a total work-around compared to writing our own HTTP Provider handler, but would this work if we just updated the database with the binary conversion of our own formatted html file?

QUESTION 2 - If we already ran init(like we have), would
DefaultInstance:EmailTemplate
be updated on a setup/start or any subsequent run on
star-from-init
if we included an updated base64 version our own html file to our config file based on the default provided in
zitadel/cmd
/defaults.yaml
?

HTTP Provider - https://zitadel.com/docs/guides/manage/customize/notification-providers#webhook--http-provider
API - Add HTTP Provider - https://zitadel.com/docs/apis/resources/admin/admin-service-add-email-provider-http
Was this page helpful?