Synapse: `notif_template_html` and `notif_template_text` settings should have sensible default values

Created on 15 Dec 2019  路  4Comments  路  Source: matrix-org/synapse

I get an error in synapse v1.6.1 if email.notif_template_html and email.notif_template_text is not defined in the configuration.

RuntimeError: email.enable_notifs is True but required keys are missing: mail.notif_template_html, email.notif_template_text

I thought if it not set, default templates from within the Synapse package will be used.

bug p2

Most helpful comment

I should also say that template_dir is not specially defined or changed. I need to set notif_template_html: notif_mail.html and notif_template_text: notif_mail.txt, otherwise synapse will not start. A fallback for these defaults is missing.

All 4 comments

templates from within the synapse package will be used (unless you change template_dir). notif_template_{text,html} give the name of the template to use.

I agree they should be optional though.

Related: #6583

I should also say that template_dir is not specially defined or changed. I need to set notif_template_html: notif_mail.html and notif_template_text: notif_mail.txt, otherwise synapse will not start. A fallback for these defaults is missing.

Synapse doesn't start anymore on update to 1.9.0 when having custom email templates and not have set this variables in homeserver.yaml

#   # Templates for email notifications
#   #
   notif_template_html: notif_mail.html
   notif_template_text: notif_mail.txt
#
#   # Templates for account expiry notices
#   #
   expiry_template_html: notice_expiry.html
   expiry_template_text: notice_expiry.txt
#
#   # Templates for password reset emails sent by the homeserver
#   #
   password_reset_template_html: password_reset.html
   password_reset_template_text: password_reset.txt
#
#   # Templates for registration emails sent by the homeserver
#   #
   registration_template_html: registration.html
   registration_template_text: registration.txt
#
#   # Templates for validation emails sent by the homeserver when adding an email to
#   # your user account
#   #
   add_threepid_template_html: add_threepid.html
   add_threepid_template_text: add_threepid.txt
#
#   # Templates for password reset success and failure pages that a user
#   # will see after attempting to reset their password
#   #
   password_reset_template_success_html: password_reset_success.html
   password_reset_template_failure_html: password_reset_failure.html
#
#   # Templates for registration success and failure pages that a user
#   # will see after attempting to register using an email or phone
#   #
   registration_template_success_html: registration_success.html
   registration_template_failure_html: registration_failure.html
#
#   # Templates for success and failure pages that a user will see after attempting
#   # to add an email or phone to their account
#   #
   add_threepid_success_html: add_threepid_success.html
   add_threepid_failure_html: add_threepid_failure.html

related to #6960. fixed in #6962.

Was this page helpful?
0 / 5 - 0 ratings