summary refs log tree commit diff
path: root/synapse/push
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2016-05-10 00:14:48 +0200
committerMatthew Hodgson <matthew@matrix.org>2016-05-10 00:14:48 +0200
commit55996088876664280e7a9232ca21b1875db6c413 (patch)
tree325a6a6f581c4da6eea102a375b83ef9b5fa24d2 /synapse/push
parentSwitch from CSS to Table layout for HTML mails so they work in Outlook aka Word (diff)
downloadsynapse-55996088876664280e7a9232ca21b1875db6c413.tar.xz
Switch from CSS to Table layout for HTML mails so they work in Outlook aka Word
    Remove templates-vector and theme templates with variables instead
    Switch to matrix.to URLs by default for links
Diffstat (limited to 'synapse/push')
-rw-r--r--synapse/push/mailer.py25
1 files changed, 18 insertions, 7 deletions
diff --git a/synapse/push/mailer.py b/synapse/push/mailer.py
index f60ac94a83..3c38321fdd 100644
--- a/synapse/push/mailer.py
+++ b/synapse/push/mailer.py
@@ -146,6 +146,7 @@ class Mailer(object):
             "user_display_name": user_display_name,
             "unsubscribe_link": self.make_unsubscribe_link(),
             "summary_text": summary_text,
+            "app_name": self.app_name,
             "rooms": rooms,
         }
 
@@ -164,6 +165,9 @@ class Mailer(object):
         multipart_msg.attach(text_part)
         multipart_msg.attach(html_part)
 
+        logger.info("Sending email push notification to %s" % email_address)
+        #logger.debug(html_text)
+
         yield sendmail(
             self.hs.config.email_smtp_host,
             raw_from, raw_to, multipart_msg.as_string(),
@@ -367,19 +371,26 @@ class Mailer(object):
             }
 
     def make_room_link(self, room_id):
-        # XXX: matrix.to
         # need /beta for Universal Links to work on iOS
-        return "https://vector.im/beta/#/room/%s" % (room_id,)
+        if self.app_name == "Vector":
+            return "https://vector.im/beta/#/room/%s" % (room_id,)
+        else:
+            return "https://matrix.to/#/room/%s" % (room_id,)
 
     def make_notif_link(self, notif):
-        # XXX: matrix.to
         # need /beta for Universal Links to work on iOS
-        return "https://vector.im/beta/#/room/%s/%s" % (
-            notif['room_id'], notif['event_id']
-        )
+        if self.app_name == "Vector":
+            return "https://vector.im/beta/#/room/%s/%s" % (
+                notif['room_id'], notif['event_id']
+            )
+        else:
+            return "https://matrix.to/#/room/%s/%s" % (
+                notif['room_id'], notif['event_id']
+            )
 
     def make_unsubscribe_link(self):
-        return "https://vector.im/#/settings"  # XXX: matrix.to
+        # XXX: matrix.to
+        return "https://vector.im/#/settings"
 
     def mxc_to_http_filter(self, value, width, height, resize_method="crop"):
         if value[0:6] != "mxc://":