1 files changed, 8 insertions, 5 deletions
diff --git a/synapse/config/account_validity.py b/synapse/config/account_validity.py
index c58a7d95a7..842fe2ebf5 100644
--- a/synapse/config/account_validity.py
+++ b/synapse/config/account_validity.py
@@ -54,16 +54,19 @@ class AccountValidityConfig(Config):
raise ConfigError("Can't send renewal emails without 'public_baseurl'")
# Load account validity templates.
- account_validity_template_dir = account_validity_config.get("template_dir")
-
+ # We do this here instead of in AccountValidityConfig as read_templates
+ # relies on state that hasn't been initialised in AccountValidityConfig
account_renewed_template_filename = account_validity_config.get(
"account_renewed_html_path", "account_renewed.html"
)
+ account_previously_renewed_template_filename = account_validity_config.get(
+ "account_previously_renewed_html_path", "account_previously_renewed.html"
+ )
invalid_token_template_filename = account_validity_config.get(
"invalid_token_html_path", "invalid_token.html"
)
+ custom_template_directory = account_validity_config.get("template_dir")
- # Read and store template content
(
self.account_validity_account_renewed_template,
self.account_validity_account_previously_renewed_template,
@@ -71,10 +74,10 @@ class AccountValidityConfig(Config):
) = self.read_templates(
[
account_renewed_template_filename,
- "account_previously_renewed.html",
+ account_previously_renewed_template_filename,
invalid_token_template_filename,
],
- account_validity_template_dir,
+ custom_template_directory=custom_template_directory,
)
def generate_config_section(self, **kwargs):
|