Opened 8 years ago

Closed 8 years ago

#3307 closed enhancement (fixed)

Implement BCC in the mail framework

Reported by: ubernostrum Owned by: adrian
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 ubernostrum 8 years ago.
Patch which implements this proposal
only_suppress_recipients.diff (2.8 KB) - added by mssnlayam@… 8 years ago.
Patch with only suppress_recipients

Download all attachments as: .zip

Change History (11)

Changed 8 years ago by ubernostrum

Patch which implements this proposal

comment:1 Changed 8 years ago by ubernostrum

  • Summary changed from Add some extra functionality to django.core.mail.send_mass_mail to [patch] Add some extra functionality to django.core.mail.send_mass_mail

comment:2 Changed 8 years ago by russellm

Point 1 is a duplicate of #1541.

comment:3 Changed 8 years ago by ubernostrum

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 8 years ago by SmileyChris

  • Patch needs improvement set
  • Triage Stage changed from Unreviewed to Accepted

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 8 years ago by mssnlayam@…

Patch with only suppress_recipients

comment:5 Changed 8 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 8 years ago by bruce@…

Please see discussion at #1541.

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

  • Component changed from Core framework to django.core.mail
  • Keywords mail bcc added
  • Summary changed from [patch] Add some extra functionality to django.core.mail.send_mass_mail to Implement 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 8 years ago by Simon G. <dev@…>

  • Triage Stage changed from Accepted to Design decision needed

comment:9 Changed 8 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(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