Opened 10 years ago

Closed 9 years ago

#3307 closed enhancement (fixed)

Implement BCC in the mail framework

Reported by: James Bennett Owned by: Adrian Holovaty
Component: Core (Mail) Version:
Severity: normal Keywords: mail, bcc
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: UI/UX:

Description

Django's built-in send_mass_mail is nice, but it's lacking two features which would make it even nicer (especially for folks who manage newsletters or other types of mailing lists):

  1. It can't handle multipart messages, which rules out sending HTML and plain-text versions of the same message.
  2. It doesn't do anything to hide the email addresses of the recipients, which is a no-no for newsletters.

So here's a proposal:

  1. Have send_mass_mail look at the message part of each datatuple; if the message is a list or tuple, send multipart with the first element being the plain-text and the second being the HTML.
  2. Add a new optional keyword argument -- suppress_recipients -- which defaults to False (for backwards compatibility) but, if True, uses only the 'first' address in recipient_list in the To: field (so the first supplied address can be a mailing-list address or other screen) and the rest will go into the Bcc: field.

Attachments (2)

mail.diff (4.0 KB) - added by James Bennett 10 years ago.
Patch which implements this proposal
only_suppress_recipients.diff (2.8 KB) - added by mssnlayam@… 10 years ago.
Patch with only suppress_recipients

Download all attachments as: .zip

Change History (11)

Changed 10 years ago by James Bennett

Attachment: mail.diff added

Patch which implements this proposal

comment:1 Changed 10 years ago by James Bennett

Summary: Add some extra functionality to django.core.mail.send_mass_mail[patch] Add some extra functionality to django.core.mail.send_mass_mail

comment:2 Changed 10 years ago by Russell Keith-Magee

Point 1 is a duplicate of #1541.

comment:3 Changed 10 years ago by James Bennett

Hmm. I thought I'd searched on this previously and not found anything, but I guess I was wrong. #1541 has a safer implementation of the multipart stuff.

comment:4 Changed 10 years ago by Chris Beaven

Patch needs improvement: set
Triage Stage: UnreviewedAccepted

Ubernostrum (or someone), could you make a new patch to just provide the suppress_recipients enhancement? Perhaps as a new ticket and then this can be closed as a dupe of that and #1541.

Changed 10 years ago by mssnlayam@…

Patch with only suppress_recipients

comment:5 Changed 10 years ago by Gary Wilson <gary.wilson@…>

To me it would seem more natural and flexible to have a recipient_list and optional bcc_list in the datatuple.

comment:6 Changed 10 years ago by bruce@…

Please see discussion at #1541.

comment:7 Changed 10 years ago by Simon G. <dev@…>

Component: Core frameworkdjango.core.mail
Keywords: mail bcc added
Summary: [patch] Add some extra functionality to django.core.mail.send_mass_mailImplement BCC in the mail framework

I'm changing this ticket to focus on the suppress recipients issue. Please continue discussion of the multipart message implementation at #1541.

I also agree with Gary here regarding the recipient_list/bcc_list issue, IMO that's more logical.

comment:8 Changed 10 years ago by Simon G. <dev@…>

Triage Stage: AcceptedDesign decision needed

comment:9 Changed 9 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

(In [5146]) Fixed #3307 -- Added BCC support to the EmailMessage class. En-passant, fixed a
number of RST formatting errors in the email docs.

Note: See TracTickets for help on using tickets.
Back to Top