mirror of
https://github.com/healthchecks/healthchecks.git
synced 2025-04-26 05:07:21 +00:00
15 lines
504 B
Python
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)
|