diff options
author | Ben Banfield-Zanin <benbz@matrix.org> | 2021-03-01 10:06:09 +0000 |
---|---|---|
committer | Ben Banfield-Zanin <benbz@matrix.org> | 2021-03-01 10:06:09 +0000 |
commit | b26bee9faf957643cd34c4146b250b0009be205d (patch) | |
tree | a7a7e29f30acb437d010bdf6116c0f2729f21a1b /synapse/config/emailconfig.py | |
parent | Merge remote-tracking branch 'origin/release-v1.26.0' into toml/keycloak_hints (diff) | |
parent | Fixup changelog (diff) | |
download | synapse-b26bee9faf957643cd34c4146b250b0009be205d.tar.xz |
Merge remote-tracking branch 'origin/release-v1.28.0' into toml/keycloak_hints github/toml/keycloak_hints toml/keycloak_hints
Diffstat (limited to '')
-rw-r--r-- | synapse/config/emailconfig.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/synapse/config/emailconfig.py b/synapse/config/emailconfig.py index 6a487afd34..52505ac5d2 100644 --- a/synapse/config/emailconfig.py +++ b/synapse/config/emailconfig.py @@ -166,6 +166,11 @@ class EmailConfig(Config): if not self.email_notif_from: missing.append("email.notif_from") + # public_baseurl is required to build password reset and validation links that + # will be emailed to users + if config.get("public_baseurl") is None: + missing.append("public_baseurl") + if missing: raise ConfigError( MISSING_PASSWORD_RESET_CONFIG_ERROR % (", ".join(missing),) @@ -264,6 +269,9 @@ class EmailConfig(Config): if not self.email_notif_from: missing.append("email.notif_from") + if config.get("public_baseurl") is None: + missing.append("public_baseurl") + if missing: raise ConfigError( "email.enable_notifs is True but required keys are missing: %s" @@ -281,7 +289,8 @@ class EmailConfig(Config): self.email_notif_template_html, self.email_notif_template_text, ) = self.read_templates( - [notif_template_html, notif_template_text], template_dir, + [notif_template_html, notif_template_text], + template_dir, ) self.email_notif_for_new_users = email_config.get( @@ -303,7 +312,8 @@ class EmailConfig(Config): self.account_validity_template_html, self.account_validity_template_text, ) = self.read_templates( - [expiry_template_html, expiry_template_text], template_dir, + [expiry_template_html, expiry_template_text], + template_dir, ) subjects_config = email_config.get("subjects", {}) |