Ticket #4707: mail_attachements.diff

File mail_attachements.diff, 1.3 KB (added by calvin@…, 8 years ago)
  • django/core/mail.py

     
    288288    messages = [EmailMessage(subject, message, sender, recipient) for subject, message, sender, recipient in datatuple]
    289289    return connection.send_messages(messages)
    290290
    291 def mail_admins(subject, message, fail_silently=False):
     291def mail_admins(subject, message, fail_silently=False, attachements=None):
    292292    "Sends a message to the admins, as defined by the ADMINS setting."
    293293    EmailMessage(settings.EMAIL_SUBJECT_PREFIX + subject, message,
    294294            settings.SERVER_EMAIL, [a[1] for a in
    295                 settings.ADMINS]).send(fail_silently=fail_silently)
     295                settings.ADMINS], attachements=attachements).send(fail_silently=fail_silently)
    296296
    297 def mail_managers(subject, message, fail_silently=False):
     297def mail_managers(subject, message, fail_silently=False, attachements=None):
    298298    "Sends a message to the managers, as defined by the MANAGERS setting."
    299299    EmailMessage(settings.EMAIL_SUBJECT_PREFIX + subject, message,
    300300            settings.SERVER_EMAIL, [a[1] for a in
    301                 settings.MANAGERS]).send(fail_silently=fail_silently)
     301                settings.MANAGERS], attachements=attachements).send(fail_silently=fail_silently)
    302302
Back to Top