summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2016-04-28 15:12:14 +0100
committerDavid Baker <dave@matrix.org>2016-04-28 15:12:14 +0100
commit937c407eef78648f1c4c1afe56fdfd8598315b19 (patch)
treef6784f9b4c2c042397f12f368ed605d68a147f77
parentHandle room invites in email notifs (diff)
downloadsynapse-937c407eef78648f1c4c1afe56fdfd8598315b19.tar.xz
Only import email pusher if email notifs are on
-rw-r--r--synapse/push/pusher.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/synapse/push/pusher.py b/synapse/push/pusher.py
index f7c3021fcc..25a45af775 100644
--- a/synapse/push/pusher.py
+++ b/synapse/push/pusher.py
@@ -1,12 +1,14 @@
 from httppusher import HttpPusher
-from emailpusher import EmailPusher
-
-PUSHER_TYPES = {
-    'http': HttpPusher,
-    'email': EmailPusher,
-}
 
 
 def create_pusher(hs, pusherdict):
+    PUSHER_TYPES = {
+        "http": HttpPusher,
+    }
+
+    if hs.config.email_enable_notifs:
+        from emailpusher import EmailPusher
+        PUSHER_TYPES["email"] = EmailPusher
+
     if pusherdict['kind'] in PUSHER_TYPES:
         return PUSHER_TYPES[pusherdict['kind']](hs, pusherdict)