summary refs log tree commit diff
path: root/synapse/config/emailconfig.py
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2021-08-17 12:23:14 +0200
committerGitHub <noreply@github.com>2021-08-17 10:23:14 +0000
commitae2714c1f31f2a843e19dc44501784401181162c (patch)
tree8b06ce2839ea5617ec55b61c834c5e3f7b1df1f1 /synapse/config/emailconfig.py
parentAdd an admin API to check if a username is available (#10578) (diff)
downloadsynapse-ae2714c1f31f2a843e19dc44501784401181162c.tar.xz
Allow using several custom template directories (#10587)
Allow using several directories in read_templates.
Diffstat (limited to 'synapse/config/emailconfig.py')
-rw-r--r--synapse/config/emailconfig.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/config/emailconfig.py b/synapse/config/emailconfig.py
index 42526502f0..fc74b4a8b9 100644
--- a/synapse/config/emailconfig.py
+++ b/synapse/config/emailconfig.py
@@ -257,7 +257,9 @@ class EmailConfig(Config):
                     registration_template_success_html,
                     add_threepid_template_success_html,
                 ],
-                template_dir,
+                (
+                    td for td in (template_dir,) if td
+                ),  # Filter out template_dir if not provided
             )
 
             # Render templates that do not contain any placeholders
@@ -297,7 +299,7 @@ class EmailConfig(Config):
                 self.email_notif_template_text,
             ) = self.read_templates(
                 [notif_template_html, notif_template_text],
-                template_dir,
+                (td for td in (template_dir,) if td),
             )
 
             self.email_notif_for_new_users = email_config.get(
@@ -320,7 +322,7 @@ class EmailConfig(Config):
                 self.account_validity_template_text,
             ) = self.read_templates(
                 [expiry_template_html, expiry_template_text],
-                template_dir,
+                (td for td in (template_dir,) if td),
             )
 
         subjects_config = email_config.get("subjects", {})