summary refs log tree commit diff
path: root/synapse/push
diff options
context:
space:
mode:
authorDavid Baker <dbkr@users.noreply.github.com>2017-01-18 14:38:49 +0000
committerGitHub <noreply@github.com>2017-01-18 14:38:49 +0000
commit97d39183770a8c376261527d4766bdb9465e96b5 (patch)
tree7507b844c5e032740a24b930069c41d706a340d8 /synapse/push
parentMerge pull request #1827 from matrix-org/dbkr/email_case_insensitive (diff)
parentAllow configuring the Riot URL used in notification emails (diff)
downloadsynapse-97d39183770a8c376261527d4766bdb9465e96b5.tar.xz
Merge pull request #1811 from aperezdc/unhardcode-riot-urls
Allow configuring the Riot URL used in notification emails
Diffstat (limited to 'synapse/push')
-rw-r--r--synapse/push/mailer.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/synapse/push/mailer.py b/synapse/push/mailer.py
index 53551632b6..ce2d31fb98 100644
--- a/synapse/push/mailer.py
+++ b/synapse/push/mailer.py
@@ -439,15 +439,23 @@ class Mailer(object):
                 })
 
     def make_room_link(self, room_id):
-        # need /beta for Universal Links to work on iOS
-        if self.app_name == "Vector":
-            return "https://vector.im/beta/#/room/%s" % (room_id,)
+        if self.hs.config.email_riot_base_url:
+            base_url = self.hs.config.email_riot_base_url
+        elif self.app_name == "Vector":
+            # need /beta for Universal Links to work on iOS
+            base_url = "https://vector.im/beta/#/room"
         else:
-            return "https://matrix.to/#/%s" % (room_id,)
+            base_url = "https://matrix.to/#"
+        return "%s/%s" % (base_url, room_id)
 
     def make_notif_link(self, notif):
-        # need /beta for Universal Links to work on iOS
-        if self.app_name == "Vector":
+        if self.hs.config.email_riot_base_url:
+            return "%s/#/room/%s/%s" % (
+                self.hs.config.email_riot_base_url,
+                notif['room_id'], notif['event_id']
+            )
+        elif self.app_name == "Vector":
+            # need /beta for Universal Links to work on iOS
             return "https://vector.im/beta/#/room/%s/%s" % (
                 notif['room_id'], notif['event_id']
             )