0
0
Fork 0
mirror of https://github.com/healthchecks/healthchecks.git synced 2025-04-26 05:07:21 +00:00
healthchecks_healthchecks/hc/lib/emails.py
2015-06-16 11:33:12 +03:00

15 lines
504 B
Python

from django.core.mail import send_mail
def send_status_notification(check):
if check.status == "down":
subject = "Alert DOWN"
body = "Hi, the check %s has gone down" % check.code
elif check.status == "up":
subject = "Alert UP"
body = "Hi, the check %s has gone up" % check.code
else:
raise NotImplemented("Unexpected status: %s" % check.status)
send_mail(subject, body, 'cuu508@gmail.com', [check.user.email],
fail_silently=False)