Django

Code

Ticket #3307 (closed: fixed)

Opened 2 years ago

Last modified 1 year ago

Implement BCC in the mail framework

Reported by: ubernostrum Assigned to: adrian
Milestone: Component: django.core.mail
Version: Keywords: mail, bcc
Cc: Triage Stage: Design decision needed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 1

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

mail.diff (4.0 kB) - added by ubernostrum on 01/15/07 10:41:06.
Patch which implements this proposal
only_suppress_recipients.diff (2.8 kB) - added by mssnlayam@yahoo.com on 01/20/07 17:28:59.
Patch with only suppress_recipients

Change History

01/15/07 10:41:06 changed by ubernostrum

  • attachment mail.diff added.

Patch which implements this proposal

01/15/07 10:41:20 changed 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.

01/15/07 23:07:45 changed by russellm

Point 1 is a duplicate of #1541.

01/17/07 03:25:53 changed 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.

01/18/07 14:26:58 changed by SmileyChris

  • needs_better_patch set to 1.
  • 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.

01/20/07 17:28:59 changed by mssnlayam@yahoo.com

  • attachment only_suppress_recipients.diff added.

Patch with only suppress_recipients

01/24/07 22:58:47 changed by Gary Wilson <gary.wilson@gmail.com>

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

02/03/07 19:48:49 changed by bruce@coderseye.com

Please see discussion at #1541.

03/08/07 05:51:03 changed by Simon G. <dev@simon.net.nz>

  • keywords set to mail, bcc.
  • component changed from Core framework to django.core.mail.
  • 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.

03/08/07 05:51:26 changed by Simon G. <dev@simon.net.nz>

  • stage changed from Accepted to Design decision needed.

05/03/07 09:38:46 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #3307 (Implement BCC in the mail framework)




Change Properties
Action