Add a periodic administrative notification

This commit is contained in:
Matthew Jones
2016-02-23 10:59:08 -05:00
parent ab3669efa9
commit 4928badd3f
3 changed files with 39 additions and 6 deletions

View File

@@ -21,13 +21,11 @@ class WebhookBackend(TowerBaseEmailBackend):
super(WebhookBackend, self).__init__(fail_silently=fail_silently)
def format_body(self, body):
logger.error("Generating body from {}".format(str(body)))
return body
def send_messages(self, messages):
sent_messages = 0
for m in messages:
logger.error("BODY: " + str(m.body))
r = requests.post("{}".format(m.recipients()[0]),
data=json.dumps(m.body),
headers=self.headers)