Quantcast

feature request: include optional html_message in send_mass_mail tuple

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

feature request: include optional html_message in send_mass_mail tuple

Michael Scheper-3
It seems I'm not the only one who wants to include HTML in messages sent via send_mass_mail(). It also seems an easy feature to add; if the tuple has a fifth element, assume it's an html_message.

Actually, I feel like I'm reinventing the wheel by passing it though django.template.loader.render_to_string(), too. I've copied the same six-line function to numerous projects already.

I'm suggesting these features here, as per Requesting features in the docs.

Thanks!

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/903b2b9c-5d27-4567-bd5f-c227f2cccca0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: feature request: include optional html_message in send_mass_mail tuple

Tim Graham-2
Hi Michael, it looks like we're not enhancing send_mass_mail() as per the docstring [0]: "The API for this method is frozen. New code wanting to extend the functionality should use the EmailMessage class directly." Perhaps the documentation could be clarified.

[0] https://github.com/django/django/commit/d5d2072bbfc38015a93d6e13136c3f1dbf125d87

On Friday, March 3, 2017 at 7:26:48 PM UTC-5, Michael Scheper wrote:
It seems <a href="http://stackoverflow.com/questions/7583801/send-mass-emails-with-emailmultialternatives" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fstackoverflow.com%2Fquestions%2F7583801%2Fsend-mass-emails-with-emailmultialternatives\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEfsGKRlhIt2K-bYAM4FZLrVGu_4A&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fstackoverflow.com%2Fquestions%2F7583801%2Fsend-mass-emails-with-emailmultialternatives\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEfsGKRlhIt2K-bYAM4FZLrVGu_4A&#39;;return true;">I'm not the only one who wants to include HTML in messages sent via <a href="https://docs.djangoproject.com/en/1.10/topics/email/#send-mass-mail" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdocs.djangoproject.com%2Fen%2F1.10%2Ftopics%2Femail%2F%23send-mass-mail\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF13WsfWvKT0c48wIlHW6jixq-xow&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdocs.djangoproject.com%2Fen%2F1.10%2Ftopics%2Femail%2F%23send-mass-mail\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF13WsfWvKT0c48wIlHW6jixq-xow&#39;;return true;">send_mass_mail(). It also seems an easy feature to add; if the tuple has a fifth element, assume it's an html_message.

Actually, I feel like I'm reinventing the wheel by passing it though <a href="https://docs.djangoproject.com/en/1.10/topics/templates/#django.template.loader.render_to_string" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdocs.djangoproject.com%2Fen%2F1.10%2Ftopics%2Ftemplates%2F%23django.template.loader.render_to_string\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGKQmzqFFJ2LoVCylPMhHJk1tZqQA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdocs.djangoproject.com%2Fen%2F1.10%2Ftopics%2Ftemplates%2F%23django.template.loader.render_to_string\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGKQmzqFFJ2LoVCylPMhHJk1tZqQA&#39;;return true;">django.template.loader.render_to_string(), too. I've copied the same six-line function to numerous projects already.

I'm suggesting these features here, as per <a href="https://docs.djangoproject.com/en/dev/internals/contributing/bugs-and-features/#requesting-features" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdocs.djangoproject.com%2Fen%2Fdev%2Finternals%2Fcontributing%2Fbugs-and-features%2F%23requesting-features\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHXjIh0yJ0A5b10WgP0m2Nd3LottA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdocs.djangoproject.com%2Fen%2Fdev%2Finternals%2Fcontributing%2Fbugs-and-features%2F%23requesting-features\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHXjIh0yJ0A5b10WgP0m2Nd3LottA&#39;;return true;">Requesting features in the docs.

Thanks!

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/915c59f9-c811-4c6a-94c6-1f1f334f79f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: feature request: include optional html_message in send_mass_mail tuple

Luan Roger Santos Santana
In reply to this post by Michael Scheper-3
Django has another option to send HTML messages. We can use the render_to_string() function to generate the message and then send it using send_mass_mail()

Em sexta-feira, 3 de março de 2017 21:26:48 UTC-3, Michael Scheper escreveu:
It seems <a href="http://stackoverflow.com/questions/7583801/send-mass-emails-with-emailmultialternatives" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fstackoverflow.com%2Fquestions%2F7583801%2Fsend-mass-emails-with-emailmultialternatives\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEfsGKRlhIt2K-bYAM4FZLrVGu_4A&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fstackoverflow.com%2Fquestions%2F7583801%2Fsend-mass-emails-with-emailmultialternatives\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEfsGKRlhIt2K-bYAM4FZLrVGu_4A&#39;;return true;">I'm not the only one who wants to include HTML in messages sent via <a href="https://docs.djangoproject.com/en/1.10/topics/email/#send-mass-mail" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdocs.djangoproject.com%2Fen%2F1.10%2Ftopics%2Femail%2F%23send-mass-mail\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF13WsfWvKT0c48wIlHW6jixq-xow&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdocs.djangoproject.com%2Fen%2F1.10%2Ftopics%2Femail%2F%23send-mass-mail\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF13WsfWvKT0c48wIlHW6jixq-xow&#39;;return true;">send_mass_mail(). It also seems an easy feature to add; if the tuple has a fifth element, assume it's an html_message.

Actually, I feel like I'm reinventing the wheel by passing it though <a href="https://docs.djangoproject.com/en/1.10/topics/templates/#django.template.loader.render_to_string" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdocs.djangoproject.com%2Fen%2F1.10%2Ftopics%2Ftemplates%2F%23django.template.loader.render_to_string\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGKQmzqFFJ2LoVCylPMhHJk1tZqQA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdocs.djangoproject.com%2Fen%2F1.10%2Ftopics%2Ftemplates%2F%23django.template.loader.render_to_string\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGKQmzqFFJ2LoVCylPMhHJk1tZqQA&#39;;return true;">django.template.loader.render_to_string(), too. I've copied the same six-line function to numerous projects already.

I'm suggesting these features here, as per <a href="https://docs.djangoproject.com/en/dev/internals/contributing/bugs-and-features/#requesting-features" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdocs.djangoproject.com%2Fen%2Fdev%2Finternals%2Fcontributing%2Fbugs-and-features%2F%23requesting-features\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHXjIh0yJ0A5b10WgP0m2Nd3LottA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdocs.djangoproject.com%2Fen%2Fdev%2Finternals%2Fcontributing%2Fbugs-and-features%2F%23requesting-features\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHXjIh0yJ0A5b10WgP0m2Nd3LottA&#39;;return true;">Requesting features in the docs.

Thanks!

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/b663578b-bbd2-4f9e-a9d9-f9c87a74c93c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...