From 393d6e7fa81a1bd0b997aa21038cae228bdb7bcc Mon Sep 17 00:00:00 2001 From: crccheck Date: Thu, 26 Sep 2013 15:32:26 -0500 Subject: [PATCH] Fix: html messages were sent as text If you followed the instructions at: , djrill would send the body as 'text' instead of 'html', resulting in ugly emails. This also fixes how `[auto_text]` could be set, but couldn't do anything. If you wanted to use `auto_text=True`, you would have to send a null body and then `attach_alternative` your real body. I didn't add a test case for this because they're like... orthogonal..., and gets into behavior testing vs unit testing. [auto_text]: https://djrill.readthedocs.org/en/master/usage/sending_mail/#auto_text --- djrill/mail/backends/djrill.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/djrill/mail/backends/djrill.py b/djrill/mail/backends/djrill.py index 4b39067..0828b37 100644 --- a/djrill/mail/backends/djrill.py +++ b/djrill/mail/backends/djrill.py @@ -112,8 +112,9 @@ class DjrillBackend(BaseEmailBackend): to_list = [{"email": to_email, "name": to_name} for (to_name, to_email) in parsed_rcpts] + content = "html" if message.content_subtype == "html" else "text" msg_dict = { - "text": message.body, + content: message.body, "subject": message.subject, "from_email": from_email, "to": to_list