Added config option to switch off email notifications.

This commit is contained in:
2018-01-23 20:07:36 +01:00
parent 1675878595
commit 7de503f91e
2 changed files with 3 additions and 0 deletions

View File

@@ -2,6 +2,7 @@
from django.utils.translation import ugettext_lazy as _
# E-Mails
ENABLE_EMAIL_NOTIFICATIONS = True
EMAIL_SENDER = 'Jens Kleineheismann <kleineheismann@kit.edu>'
BASE_URL = 'http://localhost:8000'

View File

@@ -49,6 +49,8 @@ class AbstractMail(object):
raise NotImplementedError()
def send(self):
if not config.ENABLE_EMAIL_NOTIFICATIONS:
return None
subject = self._get_subject()
body = self._get_body()
sender = self._sender