/usr/lib/python2.7/dist-packages/graphite/dashboard/send_graph.py is in graphite-web 0.9.12+debian-6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | from django.core.mail import EmailMessage
from graphite.logger import log
def send_graph_email(subject, sender, recipients, attachments=None, body=None):
"""
:param str sender: sender's email address
:param list recipients: list of recipient emails
:param list attachments: list of triples of the form:
(filename, content, mimetype). See the django docs
https://docs.djangoproject.com/en/1.3/topics/email/#django.core.mail.EmailMessage
"""
attachments = attachments or []
msg = EmailMessage(subject=subject,
from_email=sender,
to=recipients,
body=body,
attachments=attachments)
msg.send()
|