Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#13471 closed (fixed)

send_mass_mail() example

Reported by: Greg Taylor Owned by: nobody
Component: Documentation Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I've attached a patch that elaborates on the usage of the datatuple argument to send_mass_mail(). I confused myself with my first attempt at using this function by doing something like:

('test', 'testmsg', 'noreply@coursebookapp.com', ('snagglepants@gmail.com', 'gtaylor@l11solutions.com'))

I thought that the documentation was saying that connections were made to the server for each and every recipient in send_mail(), which is not the case. So I took my arguments from send_mail() and constructed a datatuple for send_mass_mail(), since that re-used the same connection. As silly as I later found it was to do this, I think it's worth pointing out the usage of datatuple explicitly so that people can draw this conclusion for themselves.

The patch suggests that send_mass_mail() can be used to send multiple, completely arbitrary emails to one or more completely different set of recipients. I also show that you need a tuple of tuples, rather than a single datatuple.

Attachments (1)

send_mass_mail_elab.diff (774 bytes) - added by Greg Taylor 6 years ago.
Patch for the suggested documentation change.

Download all attachments as: .zip

Change History (6)

Changed 6 years ago by Greg Taylor

Attachment: send_mass_mail_elab.diff added

Patch for the suggested documentation change.

comment:1 Changed 6 years ago by Gabriel Hurley

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Summary: send_mass_mail() elaborationsend_mass_mail() example
Triage Stage: UnreviewedAccepted

The docs do explain the datatuple pretty explicitly, but an example couldn't hurt. My only question is whether that's the best place for it or whether it should be *above* the "send_mass_mail() vs. send_mail()" section?

comment:2 Changed 6 years ago by Greg Taylor

I don't mind either way. If you or whoever ends up deciding it's better above that header, let me know and I can re-work it.

comment:3 Changed 6 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(In [13127]) Fixed #13471 -- Added example of send_mass_mail usage. Thanks to gtaylor for the report and patch.

comment:4 Changed 6 years ago by Russell Keith-Magee

(In [13131]) [1.1.X] Fixed #13471 -- Added example of send_mass_mail usage. Thanks to gtaylor for the report and patch.

Backport of r13127 from trunk.

comment:5 Changed 5 years ago by Jacob

milestone: 1.2

Milestone 1.2 deleted

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