summary refs log tree commit diff
path: root/synapse/push
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/push')
-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)