mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-24 11:39:24 -05:00
Add config option to not send email notifs for new users
This commit is contained in:
parent
e04b1d6b0a
commit
94040b0798
@ -65,6 +65,9 @@ class EmailConfig(Config):
|
|||||||
self.email_template_dir = email_config["template_dir"]
|
self.email_template_dir = email_config["template_dir"]
|
||||||
self.email_notif_template_html = email_config["notif_template_html"]
|
self.email_notif_template_html = email_config["notif_template_html"]
|
||||||
self.email_notif_template_text = email_config["notif_template_text"]
|
self.email_notif_template_text = email_config["notif_template_text"]
|
||||||
|
self.email_notifs_for_new_users = email_config.get(
|
||||||
|
"notif_for_new_users", True
|
||||||
|
)
|
||||||
if "app_name" in email_config:
|
if "app_name" in email_config:
|
||||||
self.email_app_name = email_config["app_name"]
|
self.email_app_name = email_config["app_name"]
|
||||||
else:
|
else:
|
||||||
@ -91,4 +94,5 @@ class EmailConfig(Config):
|
|||||||
# template_dir: res/templates
|
# template_dir: res/templates
|
||||||
# notif_template_html: notif_mail.html
|
# notif_template_html: notif_mail.html
|
||||||
# notif_template_text: notif_mail.txt
|
# notif_template_text: notif_mail.txt
|
||||||
|
# notif_for_new_users: True
|
||||||
"""
|
"""
|
||||||
|
@ -219,7 +219,10 @@ class RegisterRestServlet(RestServlet):
|
|||||||
# if email notifications are enabled (so people don't start
|
# if email notifications are enabled (so people don't start
|
||||||
# getting mail spam where they weren't before if email
|
# getting mail spam where they weren't before if email
|
||||||
# notifs are set up on a home server)
|
# notifs are set up on a home server)
|
||||||
if self.hs.config.email_enable_notifs:
|
if (
|
||||||
|
self.hs.config.email_enable_notifs and
|
||||||
|
self.hs.config.email_notifs_for_new_users
|
||||||
|
):
|
||||||
# Pull the ID of the access token back out of the db
|
# Pull the ID of the access token back out of the db
|
||||||
# It would really make more sense for this to be passed
|
# It would really make more sense for this to be passed
|
||||||
# up when the access token is saved, but that's quite an
|
# up when the access token is saved, but that's quite an
|
||||||
|
Loading…
Reference in New Issue
Block a user