Code

Ticket #4707: mail_attachments_1.diff

File mail_attachments_1.diff, 1.3 KB (added by thejaswi_puthraya, 6 years ago)

corrected the typos in the previous diff

Line 
1Index: django/core/mail.py
2===================================================================
3--- django/core/mail.py (revision 6783)
4+++ django/core/mail.py (working copy)
5@@ -347,15 +347,15 @@
6     messages = [EmailMessage(subject, message, sender, recipient) for subject, message, sender, recipient in datatuple]
7     return connection.send_messages(messages)
8 
9-def mail_admins(subject, message, fail_silently=False):
10+def mail_admins(subject, message, fail_silently=False, attachments=None):
11     "Sends a message to the admins, as defined by the ADMINS setting."
12     EmailMessage(settings.EMAIL_SUBJECT_PREFIX + subject, message,
13             settings.SERVER_EMAIL, [a[1] for a in
14-                settings.ADMINS]).send(fail_silently=fail_silently)
15+                settings.ADMINS],attachments=attachments).send(fail_silently=fail_silently)
16 
17-def mail_managers(subject, message, fail_silently=False):
18+def mail_managers(subject, message, fail_silently=False, attachments=None):
19     "Sends a message to the managers, as defined by the MANAGERS setting."
20     EmailMessage(settings.EMAIL_SUBJECT_PREFIX + subject, message,
21             settings.SERVER_EMAIL, [a[1] for a in
22-                settings.MANAGERS]).send(fail_silently=fail_silently)
23+                settings.MANAGERS],attachments=attachments).send(fail_silently=fail_silently)
24