summary refs log tree commit diff
path: root/synapse/push/mailer.py
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@arasphere.net>2016-05-17 10:43:24 +0100
committerMatthew Hodgson <matthew@arasphere.net>2016-05-17 10:43:24 +0100
commit43e1e0489c956e43099e7f0daf8392396b0fb3dd (patch)
tree0f3b91362bab27f3fd2b9e416e6b409563f9d08d /synapse/push/mailer.py
parentMerge pull request #789 from matrix-org/markjh/member_cleanup (diff)
parenttweak text (diff)
downloadsynapse-43e1e0489c956e43099e7f0daf8392396b0fb3dd.tar.xz
Merge pull request #786 from matrix-org/matthew/email_notifs_tuning
tune email notifs, fix CSS a bit, and add debugging details
Diffstat (limited to 'synapse/push/mailer.py')
-rw-r--r--synapse/push/mailer.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/synapse/push/mailer.py b/synapse/push/mailer.py
index 2fd38a036a..c2c2ca3fa7 100644
--- a/synapse/push/mailer.py
+++ b/synapse/push/mailer.py
@@ -92,7 +92,7 @@ class Mailer(object):
         )
 
     @defer.inlineCallbacks
-    def send_notification_mail(self, user_id, email_address, push_actions):
+    def send_notification_mail(self, user_id, email_address, push_actions, reason):
         raw_from = email.utils.parseaddr(self.hs.config.email_notif_from)[1]
         raw_to = email.utils.parseaddr(email_address)[1]
 
@@ -143,12 +143,17 @@ class Mailer(object):
             notifs_by_room, state_by_room, notif_events, user_id
         )
 
+        reason['room_name'] = calculate_room_name(
+            state_by_room[reason['room_id']], user_id, fallback_to_members=False
+        )
+
         template_vars = {
             "user_display_name": user_display_name,
             "unsubscribe_link": self.make_unsubscribe_link(),
             "summary_text": summary_text,
             "app_name": self.app_name,
             "rooms": rooms,
+            "reason": reason,
         }
 
         html_text = self.notif_template_html.render(**template_vars)