#20194: "console", "dummy", and "locmem" email backends should accept generators to send_messages() just as "smtp" backend does -------------------------------------+------------------------------------- Reporter: brendoncrawford | Owner: Type: | brendoncrawford Cleanup/optimization | Status: assigned Component: Core (Mail) | Version: master Severity: Normal | Resolution: Keywords: email, email | Triage Stage: backends, emailbackend | Unreviewed Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Changes (by brendoncrawford):
* owner: nobody => brendoncrawford * status: new => assigned * has_patch: 0 => 1 * needs_tests: 1 => 0 Comment: Github Pull Request is Here: https://github.com/django/django/pull/991 Test: {{{ from django.core.management.base import BaseCommand from django.core import mail class Command(BaseCommand): help = 'Test for https://code.djangoproject.com/ticket/20194' def handle(self, *args, **options): mail_from = "root+foo@localhost" msgs = [ ("root+baz@localhost", "Test 1", "Test 1 Body"), ("root+baz@localhost", "Test 2", "Test 2 Body") ] cb = lambda m: mail.EmailMessage(m[1], m[2], mail_from, [m[0]]) email_messages = (cb(m) for m in msgs) conn = mail.get_connection() conn.open() sent_count = conn.send_messages(email_messages) conn.close() print("Sent: %d" % sent_count) return '' }}} -- Ticket URL: <https://code.djangoproject.com/ticket/20194#comment:2> 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 unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.