From 13c6125bda68abad78c69cc0e675c1fb8457ba01 Mon Sep 17 00:00:00 2001 From: medmunds Date: Tue, 5 Mar 2013 13:57:51 -0800 Subject: [PATCH] Support Mandrill inline_css sending option --- djrill/mail/backends/djrill.py | 2 +- djrill/tests/test_mandrill_send.py | 3 +++ docs/usage/sending_mail.rst | 7 +++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/djrill/mail/backends/djrill.py b/djrill/mail/backends/djrill.py index 5a31d7a..260b1f3 100644 --- a/djrill/mail/backends/djrill.py +++ b/djrill/mail/backends/djrill.py @@ -144,7 +144,7 @@ class DjrillBackend(BaseEmailBackend): # Mandrill attributes that can be copied directly: mandrill_attrs = [ 'from_name', # overrides display name parsed from from_email above - 'track_opens', 'track_clicks', 'auto_text', 'url_strip_qs', + 'track_opens', 'track_clicks', 'auto_text', 'inline_css', 'url_strip_qs', 'tags', 'preserve_recipients', 'google_analytics_domains', 'google_analytics_campaign', 'metadata'] diff --git a/djrill/tests/test_mandrill_send.py b/djrill/tests/test_mandrill_send.py index a70be22..ab309c1 100644 --- a/djrill/tests/test_mandrill_send.py +++ b/djrill/tests/test_mandrill_send.py @@ -296,10 +296,12 @@ class DjrillMandrillFeatureTests(DjrillBackendMockAPITestCase): def test_message_options(self): self.message.auto_text = True + self.message.inline_css = True self.message.preserve_recipients = True self.message.send() data = self.get_api_call_data() self.assertEqual(data['message']['auto_text'], True) + self.assertEqual(data['message']['inline_css'], True) self.assertEqual(data['message']['preserve_recipients'], True) def test_merge(self): @@ -375,6 +377,7 @@ class DjrillMandrillFeatureTests(DjrillBackendMockAPITestCase): self.assertFalse('track_opens' in data['message']) self.assertFalse('track_clicks' in data['message']) self.assertFalse('auto_text' in data['message']) + self.assertFalse('inline_css' in data['message']) self.assertFalse('url_strip_qs' in data['message']) self.assertFalse('tags' in data['message']) self.assertFalse('preserve_recipients' in data['message']) diff --git a/docs/usage/sending_mail.rst b/docs/usage/sending_mail.rst index b8e5bca..5318468 100644 --- a/docs/usage/sending_mail.rst +++ b/docs/usage/sending_mail.rst @@ -132,6 +132,13 @@ Most of the options from the Mandrill ``Boolean``: whether Mandrill should automatically generate a text body from the HTML. Default from your Mandrill account settings. +.. attribute:: inline_css + + ``Boolean``: whether Mandrill should inline CSS styles in the HTML. + Default from your Mandrill account settings. + + .. versionadded:: 0.4 + .. attribute:: url_strip_qs ``Boolean``: whether Mandrill should ignore any query parameters when aggregating