Commit Graph

37 Commits

Author SHA1 Message Date
crccheck
393d6e7fa8 Fix: html messages were sent as text
If you followed the instructions at:
<https://docs.djangoproject.com/en/1.5/topics/email/#sending-alternative-content-types>,
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
2013-09-26 15:32:55 -05:00
medmunds
717e048365 Add Mandrill send options auto_html, tracking_domain, signing_domain 2013-03-27 11:08:04 -07:00
medmunds
ab1de7be2a (Don't use python builtin 'vars' as a parameter name) 2013-03-27 11:08:04 -07:00
medmunds
64f32fbc72 Use python's json rather than Django's
django.utils.simplejson is deprecated; Python 2.6+ includes json.
Fixes #32.
2013-03-13 09:52:51 -07:00
medmunds
13c6125bda Support Mandrill inline_css sending option 2013-03-05 13:57:51 -08:00
medmunds
09de5faebe Support embedded images.
Treat image attachments with a Content-ID header as embedded, rather than ordinary attachments. (Rationale is that you must set the content-id to be able to refer to the image within your html, so that's a reasonable indicator to handle it as embedded.)
2013-03-01 13:58:07 -08:00
medmunds
92d413f5ae Don't filter attachment types
Mandrill dropped filtering on attachment mimetypes, so stop enforcing this in Djrill.
Fixes #26
2013-02-28 17:47:47 -08:00
medmunds
ed3249cede Correct name/content lists for template_content, merge_vars, global_merge_vars.
Fixes #24.
2013-01-13 08:16:40 -08:00
medmunds
ac0614a633 More Python 3.2 fixes - attachment encoding 2013-01-12 13:32:57 -08:00
medmunds
8de6b218b9 Handle bcc as Mandrill bcc_address, rather than additional to address 2013-01-12 10:26:42 -08:00
medmunds
8f9afdff7e Move MANDRILL_API_URL to package root (out of backend) 2013-01-11 17:34:17 -08:00
medmunds
ad4b9f38ff Raise NotSupportedByMandrillError for unsupported attachment mimetypes. 2013-01-11 17:26:09 -08:00
medmunds
18d27fdb21 Exception cleanup
Introduce djrill.NotSupportedByMandrillError for unsupported functionality (previously used generic ValueError).
Change to djrill.MandrillAPIError, derived from requests.HTTPError, for API error responses (previously used djrill.mail.backends.djrill.DjrillBackendHTTPError -- retained as equivalent for backwards compatibility).
2013-01-11 16:59:42 -08:00
medmunds
4be12952a3 Add send-template tests (and fixes).
Add test cases for send-template.
Expand template_content dict into Mandrill's name/value array.
Don't send template_content as "None" if missing.

Clean up some variable names in the backend.
2013-01-11 13:28:49 -08:00
medmunds
3b237a59db Merge branch 'send-template' of git://github.com/peillis/Djrill into send_template 2013-01-09 12:39:18 -08:00
medmunds
5b4f4c12cb Support sending attachments 2013-01-03 13:52:41 -08:00
peillis
046987a934 adding the send-template call 2012-12-24 13:36:37 +01:00
medmunds
8aab5e31b7 Expose most Mandrill send features on EmailMessage objects.
* Supports additional Mandrill send-API attributes on any ``EmailMessage``-derived object -- see details in readme
* Removes need for MANDRILL_API_URL in settings (since this is tightly tied to the code)
* Removes ``DjrillMessage`` from the readme (but not the code or tests) -- its functionality is now duplicated or exceeded by standard EmailMessage with additional attributes
* Ensures send(fail_silently=True) works as expected
2012-12-10 11:36:18 -08:00
Jared Morse
2eba028a1a DjrillBackend preserve_recipients 2012-12-03 18:55:05 -08:00
medmunds
d9cb23b003 Support from_name in "from_name <email>" sender address.
Allows specifying the sender's display name as part of the from email address,
without requiring use of the DjrillMessage class:

    send_mail('Subject', 'Message', 'From Name <from@example.com>',
              ['Recipient #1 <to1@example.com>', 'to2@example.com'])

(This matches the behavior of Django's default SMTP backend.)

Cherry-picked from:
medmunds/Djrill@46cd5c9d: Support "realname <email>" sender address
medmunds/Djrill@cd4e57cc: Support "realname <email>" sender address - fix for using DjrillMessage
medmunds/Djrill@16f8efc9: Add tests for "Display Name <email@example.com>" addresses
2012-11-23 10:47:20 -08:00
medmunds
c78bbc6ced [minor cleanup] Allow html from any EmailMultiAlternatives (not just DjrillMessage) 2012-11-16 11:07:15 -08:00
medmunds
c23696a590 Allow html from any EmailMultiAlternatives (not just DjrillMessage)
Includes type-checking on alternative message part, and switches
to ValueError (rather than ImproperlyConfigured) for unacceptable
alternatives.

[Also fixes bug where fail_silently=True wasn't respected.]

Cherry-picked from: medmunds/Djrill@faf53a1a0
(and parts of medmunds/Djrill@62d48c5f)
2012-11-15 16:17:16 -08:00
medmunds
1901fd444e Allow extra headers from any EmailMessage (not just DjrillMessage)
Also adds test case for basic functionality on django.core.mail.EmailMessage.

Cherry-picked from: medmunds/Djrill@f0503783f
2012-11-15 15:49:08 -08:00
medmunds
5602fc5314 Backend: Remove obsolete api_verify altogether.
Remove connection management (remnant of sender verification, and
didn't match Django email backend signatures).
Reformat inherited patch to 80-char line width.
Consistent int return type from send_messages.
2012-10-31 11:51:47 -07:00
medmunds
c1e577c6f5 Backend: fix exception messaging 2012-10-31 11:44:03 -07:00
Arnaud Fribault
96b5733e9d Fixes error message formatting 2012-10-31 11:44:03 -07:00
Arnaud Fribault
5b35988034 Raise a valid exception if failedSilently is false 2012-10-31 11:44:03 -07:00
Theo Crevon
71292aa223 Update : new sender validation endpoint and process 2012-10-30 17:21:46 +01:00
Chris Jones
e8834fe326 Handle extra headers accepted by Mandrill, also extra option of from_name. Tests to cover checking of extra headers and from_name. 2012-02-28 15:35:29 -08:00
Chris Jones
4db1b9d087 You didn't see that. 2012-02-28 15:08:28 -08:00
Chris Jones
cbd7f429d6 from_name, make it so. 2012-02-28 15:06:01 -08:00
Chris Jones
64bbd40884 No, really. Now it works with standard emails. 2012-02-28 13:08:06 -08:00
Chris Jones
91b846fea3 DjrillMessage which wraps Django's EmailMultiAlternatives. Mail backend now works with standard email and multipart through the DjrillMessage object. 2012-02-28 13:03:26 -08:00
Chris Jones
d6ff089060 Fix recipients list. 2012-02-28 11:34:48 -08:00
Chris Jones
e4362f8c34 Its broken. Parse recipients. 2012-01-20 18:24:13 -08:00
Chris Jones
3b227b2f70 Basic send_mail functioning. 2012-01-20 18:03:33 -08:00
Chris Jones
fd04e60171 Start of the mail backend for djrill. 2012-01-20 16:59:15 -08:00