Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

notif_template_html and notif_template_text settings should have sensible default values #6551

Closed
ukcb opened this issue Dec 15, 2019 · 4 comments
Labels
z-bug (Deprecated Label) z-p2 (Deprecated Label)

Comments

@ukcb
Copy link

ukcb commented Dec 15, 2019

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.

@richvdh
Copy link
Member

richvdh commented Dec 20, 2019

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

@richvdh richvdh changed the title RuntimeError: email.enable_notifs notif_template_html and notif_template_text settings should have sensible default values Dec 20, 2019
@ukcb
Copy link
Author

ukcb commented Dec 20, 2019

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.

@neilisfragile neilisfragile added z-bug (Deprecated Label) z-p2 (Deprecated Label) labels Jan 8, 2020
@a-fellerer
Copy link

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

@richvdh
Copy link
Member

richvdh commented Mar 26, 2020

related to #6960. fixed in #6962.

@richvdh richvdh closed this as completed Mar 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
z-bug (Deprecated Label) z-p2 (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

4 participants