#17811: Connection object is no passed to the EmailMessage constructor when 
called
from send_mass_mail
-----------------------------+-------------------------------------
     Reporter:  fed239       |      Owner:  nobody
         Type:  Bug          |     Status:  new
    Component:  Core (Mail)  |    Version:  1.3
     Severity:  Normal       |   Keywords:  mail, connection, email
 Triage Stage:  Unreviewed   |  Has patch:  0
Easy pickings:  0            |      UI/UX:  0
-----------------------------+-------------------------------------
 There is a difference in the behavior of send_mail and send_mass_mail
 function. send_mail passes connection as a parameter to the EmailMessage
 constructor and send_mass_mail does not.
 {{{
 44      def send_mail(subject, message, from_email, recipient_list,
 45                    fail_silently=False, auth_user=None,
 auth_password=None,
 46                    connection=None):
 ...
 57          connection = connection or get_connection(username=auth_user,
 58                                          password=auth_password,
 59                                          fail_silently=fail_silently)
 60          return EmailMessage(subject, message, from_email,
 recipient_list,
 61                              connection=connection).send()
 }}}

 {{{
 64      def send_mass_mail(datatuple, fail_silently=False, auth_user=None,
 65                         auth_password=None, connection=None):
 ...
 78          connection = connection or get_connection(username=auth_user,
 79                                          password=auth_password,
 80                                          fail_silently=fail_silently)
 81          messages = [EmailMessage(subject, message, sender, recipient)
 82                      for subject, message, sender, recipient in
 datatuple]
 83          return connection.send_messages(messages)
 }}}

 This causes troubles if email backend stores something inside the self
 object for the later use and expects that messages would have reference to
 it.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17811>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to