summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2019-04-18 14:46:08 +0100
committerBrendan Abolivier <babolivier@matrix.org>2019-04-18 14:50:05 +0100
commitf8826d31cdc974552351bfa7d14ad40bb225d3e7 (patch)
treea06c7bf66125a59738cc9bfeaa1c1553654b90d8
parentMerge branch 'develop' of github.com:matrix-org/synapse into babolivier/accou... (diff)
downloadsynapse-f8826d31cdc974552351bfa7d14ad40bb225d3e7.tar.xz
Don't crash on lack of expiry templates
-rw-r--r--changelog.d/5077.bugfix1
-rw-r--r--synapse/config/emailconfig.py8
2 files changed, 7 insertions, 2 deletions
diff --git a/changelog.d/5077.bugfix b/changelog.d/5077.bugfix
new file mode 100644
index 0000000000..f3345a6353
--- /dev/null
+++ b/changelog.d/5077.bugfix
@@ -0,0 +1 @@
+Don't crash on lack of expiry templates.
diff --git a/synapse/config/emailconfig.py b/synapse/config/emailconfig.py
index 60827be72f..342a6ce5fd 100644
--- a/synapse/config/emailconfig.py
+++ b/synapse/config/emailconfig.py
@@ -71,8 +71,12 @@ class EmailConfig(Config):
             self.email_notif_from = email_config["notif_from"]
             self.email_notif_template_html = email_config["notif_template_html"]
             self.email_notif_template_text = email_config["notif_template_text"]
-            self.email_expiry_template_html = email_config["expiry_template_html"]
-            self.email_expiry_template_text = email_config["expiry_template_text"]
+            self.email_expiry_template_html = email_config.get(
+                "expiry_template_html", "notice_expiry.html",
+            )
+            self.email_expiry_template_text = email_config.get(
+                "expiry_template_text", "notice_expiry.txt",
+            )
 
             template_dir = email_config.get("template_dir")
             # we need an absolute path, because we change directory after starting (and