Giter VIP home page Giter VIP logo

djrill's Introduction

Djrill: Mandrill Transactional Email for Django

Djrill integrates the Mandrill transactional email service into Django.

PROJECT STATUS: INACTIVE

As of April, 2016, Djrill is no longer actively maintained (other than security updates). It is likely to keep working unless/until Mandrill changes their APIs, but Djrill will not be updated for newer Django versions or Mandrill changes. (more info)

You may be interested in django-anymail, a Djrill fork that supports Mailgun, Postmark, SendGrid, and other transactional ESPs (including limited support for Mandrill).

In general, Djrill "just works" with Django's built-in django.core.mail package. It includes:

  • Support for HTML, attachments, extra headers, and other features of Django's built-in email
  • Mandrill-specific extensions like tags, metadata, tracking, and MailChimp templates
  • Optional support for Mandrill inbound email and other webhook notifications, via Django signals

Djrill is released under the BSD license. It is tested against Django 1.4--1.9 (including Python 3 with Django 1.6+, and PyPy support with Django 1.5+). Djrill uses semantic versioning.

build status on Travis-CI

Resources

Djrill 1-2-3

  1. Install Djrill from PyPI:

    $ pip install djrill
  2. Edit your project's settings.py:

    INSTALLED_APPS = (
        ...
        "djrill"
    )
    
    MANDRILL_API_KEY = "<your Mandrill key>"
    EMAIL_BACKEND = "djrill.mail.backends.djrill.DjrillBackend"
    DEFAULT_FROM_EMAIL = "[email protected]"  # if you don't already have this in settings
  3. Now the regular Django email functions will send through Mandrill:

    from django.core.mail import send_mail
    
    send_mail("It works!", "This will get sent through Mandrill",
        "Djrill Sender <[email protected]>", ["[email protected]"])

    You could send an HTML message, complete with custom Mandrill tags and metadata:

    from django.core.mail import EmailMultiAlternatives
    
    msg = EmailMultiAlternatives(
        subject="Djrill Message",
        body="This is the text email body",
        from_email="Djrill Sender <[email protected]>",
        to=["Recipient One <[email protected]>", "[email protected]"],
        headers={'Reply-To': "Service <[email protected]>"} # optional extra headers
    )
    msg.attach_alternative("<p>This is the HTML email body</p>", "text/html")
    
    # Optional Mandrill-specific extensions:
    msg.tags = ["one tag", "two tag", "red tag", "blue tag"]
    msg.metadata = {'user_id': "8675309"}
    
    # Send it:
    msg.send()

See the full documentation for more features and options.

djrill's People

Contributors

arnaudf avatar chrisjones-brack3t avatar crccheck avatar erichennings avatar freider avatar jarcoal avatar jpadilla avatar kennethlove avatar kylegibson avatar medmunds avatar nikolay-saskovets avatar omerzimp avatar pkimber avatar rebelliard avatar ulmus avatar winhamwr avatar wrhector avatar zsiciarz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

djrill's Issues

a couple of questions

Nice work. This app is interesting.
I have a couple of questions.
Is this app still actively maintained?
Using this app, the emails are sent directly through the API and not the SMTP server, correct?
What is the benefit of using the API vs the SMTP server? Faster?

Thanks

Mandrill Templates expect {name:'', content:''}

And Djrill provides {name:'', value:''} pairs for template_content.

This is what mandrill received in one call using template_name/template_content on EmailMessage().

{"template_content": [{"name": "description", "value": "This is how I found it"}, {"name": "page", "value": "\/dashboard\/"}, {"name": "title", "value": "I found a bug"}, {"name": "type", "value": "bug"}, {"name": "user", "value": "[email protected]"}], "template_name": "beta_feedback", "message": {"text": "", "from_name": "Feedback Service", "from_email": "...", "to": [{"email": "[email protected]", "name": ""}], "subject": "Feedback submitted"}, "key": "..."}

and in the api they clearly state :

"template_content": [
        {
            "name": "example name",
            "content": "example content"
        }
    ],

So basically I receive the correct email but all mc:edit fields are empty.

p.s. : I replaced any sensitive content with (...)

2.x: drop support for DjrillAdminSite

Proposal for v2.x: remove the custom DjrillAdminSite.

I'd be curious to hear how often people are actually using the Djrill admin views from within their Django projects' admin sites. (And which admin features you're using.) Please add comments to this issue if you have strong feelings one way or the other.

Rationale for removing this functionality:

  • At this point, DjrillAdminSite mainly duplicates reporting functionality that's available (in more useful form) in Mandrill's own control panel.
  • The admin views add significantly to the Django version compatibility burden. (E.g., Djrill needs to register its own cycle templatetag for compatibility, purely because of the admin templates.)
  • I suspect most Djrill users never look at the Djrill admin views. (Thus the request for feedback above.)

(Incidentally, the admin views originally helped site owners add and validate Mandrill senders -- a process that was relatively cumbersome at the time. But Mandrill dropped that requirement years ago, and we removed it from Djrill as well.)

Extra headers

As stated in your documentation about headers:

Headers

Djrill accepts additional headers, but only Reply-To and X- (since that is all that Mandrill accepts). Any other extra headers will raise NotSupportedByMandrillError when you attempt to send the message.

But looking at the mandrill documentation here it looks that most of the headers are accepted:

headers struct optional extra headers to add to the message (most headers are allowed)

Maybe they changed this and Djrill should be actualized? I have been sending off emails using this headers with no problems for example:

    message.extra_headers['Message-ID'] = make_msgid()
    message.extra_headers['Date'] = formatdate()
    message.extra_headers['In-Reply-To'] = self.message_id
    message.extra_headers['References'] = self.message_id

Sending Template documentation uses wrong Email class

The documentation for Sending Template Mail (https://djrill.readthedocs.org/en/latest/usage/templates/) appears to correctly import EmailMultiAlternatives:

from django.core.mail import EmailMultiAlternatives

But then uses EmailMessage to try to send the email, which errors.

msg = EmailMessage(subject=subject, from_email="[email protected]",
                   to=["[email protected]"], body=text_body)

I believe the only change necessary is to make this one line read:

msg = EmailMultiAlternatives(subject=subject, from_email="[email protected]",
                   to=["[email protected]"], body=text_body)

Error sending a Unicode in body. Python 2

    msg = EmailMultiAlternatives(
        subject=subject,
        body=u"This is the text email body", #<------
        from_email=from_email,
        to=["[email protected]"],
    )

throws MandrillAPIError.
stacktrace
raised unexpected: HTTPError()
Traceback (most recent call last):
File "/home/zkanda/.virtualenvs/project/local/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
R = retval = fun(_args, *_kwargs)
File "/home/zkanda/.virtualenvs/project/local/lib/python2.7/site-packages/celery/app/trace.py", line 437, in protected_call
return self.run(_args, *_kwargs)
File "/home/zkanda/project/project/project/tasks.py", line 28, in send_message
msg.send()
File "/home/zkanda/.virtualenvs/project/local/lib/python2.7/site-packages/django/core/mail/message.py", line 274, in send
return self.get_connection(fail_silently).send_messages([self])
File "/home/zkanda/.virtualenvs/project/local/lib/python2.7/site-packages/djrill/mail/backends/djrill.py", line 68, in send_messages
sent = self._send(message)
File "/home/zkanda/.virtualenvs/project/local/lib/python2.7/site-packages/djrill/mail/backends/djrill.py", line 119, in _send
(msg_dict['to'], msg_dict['from_email']))
MandrillAPIError

Signed webhooks

I've just implemented mandrill webhooks using djrill and it works like a charm. However, security could be improved by adding signature checking as per http://help.mandrill.com/entries/23704122-Authenticating-webhook-requests

Is this in the cards already? Otherwise I could take a stab at it, eg as an optional setting DJRILL_WEBHOOK_SIGNATURE_KEY that, if provided is used to check that the webhook post is properly signed.

MandrillAPIError when sending an e-mail inside a Celery task with the logging system.

Hi!

I'm using Djrill as the default email backend for Django 1.6.5:

EMAIL_BACKEND = 'djrill.mail.backends.djrill.DjrillBackend'

and I'm using it to log errors via e-mail to the user if a task running in Celery failed.

try:
    # Do something...
except (NotChangedFeed, ValueError) as e:
    # ValueError happens when feed url is empty
    pass
except Exception as e:
    if send_email:
        error_message = get_error_message(e)
        error_logger = logging.getLogger('mymodule.tasks.email')
        try:
            error_logger.error(error_message)
        except MandrillAPIError as inner_e:
            raven_client.captureMessage(inner_e.response.content)

The EmailHandler for logging does this to send the e-mail:

def _send_email(self, subject, body):
    """Sends the email if the user wants to"""
    email = EmailMultiAlternatives(subject=subject,
                from_email=self.fromaddr,
                to=(self.search_engine.user.email,))
    email.attach_alternative(body, "text/html")
    email.tags = ["error"]
    email.metadata = {'user': self.search_engine.user.username}
    # send the email only if emailme_error_log is True
    if self.search_engine.emailme_error_log:
        email.send()

The response content is:

<html>
<head><title>400 Bad Request</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx/1.6.0</center>
</body>
</html>

I've added some prints to your code to see what's being sent. The URL is:

http://mandrillapp.com/api/1.0/messages/send.json

The method is POST and the request headers are:

User-Agent:      python-requests/2.3.0 CPython/2.7.6 Linux/3.13.0-24-generic
Content-Type:    application/json
Accept-Encoding: gzip, deflate
Accept:          */*

And the body of the request (I've changed the target e-mail and API key) is:

{  
   "message":{  
      "tags":[  
         "error"
      ],
      "text":"",
      "from_email":"[email protected]",
      "to":[  
         {  
            "type":"to",
            "email":"[email protected]",
            "name":""
         }
      ],
      "html":"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n  <head>\n    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>[someapp] Error in SOME PART</title>\n\n    </head>\n  <body bgcolor=\"#D7D9DC\" style=\"padding:0; width:100%; -webkit-text-size-adjust:100%; margin:0; -ms-text-size-adjust:100%; background-color:#D7D9DC\" width=\"100%\">\n\n    <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" id=\"backgroundTable\" style=\"border-collapse:collapse; padding:0; width:100%; mso-table-rspace:0pt; mso-table-lspace:0pt; margin:0; line-height:100%\" width=\"100%\">\n    <tr>\n      <td align=\"center\" height=\"62\">&#160;</td>\n    </tr>\n    <tr>\n      <td align=\"center\">\n\n        <table align=\"center\" width=\"598\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" id=\"messageTable\" style=\"border-collapse:collapse; mso-table-lspace:0pt; border:1px solid #BDBEC3; background-color:white; mso-table-rspace:0pt\" bgcolor=\"white\">\n        <tr>\n          <td colspan=\"3\">\n            <!-- Header Starts -->\n            <table width=\"598\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" id=\"hd\" bgcolor=\"#1B1B1B\" style=\"color:#FFFFFF; border-collapse:collapse; height:30px; mso-table-rspace:0pt; mso-table-lspace:0pt; background-color:#1B1B1B\" height=\"30\">\n            <tr><td height=\"10\" colspan=\"2\" style=\"line-height:5px\">&#160;</td></tr>\n            <tr>\n              <td width=\"22\">&#160;</td>\n              <td height=\"30\" valign=\"middle\">\n                <a href=\"http://www.someapp.com\">\n                  <img src=\"https://app.someapp.com/media/images/logo-black.png\" alt=\"someapp\" width=\"117\" height=\"30\" border=\"0\" style=\"-ms-interpolation-mode:bicubic; text-decoration:none; border:none; display:block; outline:none\">\n                </a>\n              </td>\n              <td>\n                <div style=\"color:#353535; float:right; margin:0 10px 0 0; line-height:24px; font-family:helvetica, arial, sans-serif\">\n                  <a href=\"http://twitter.com/#!/someapp\" style=\"color:#FFFFFF; font-size:11px; text-decoration:none\"><img src=\"http://www.someapp.com/media/img/twitter.png\" style=\"-ms-interpolation-mode:bicubic; text-decoration:none; border:none; outline:none; margin-right:3px\">@someapp</a>\n                  <a href=\"http://www.facebook.com/pages/someapp/251257471600587?fref=ts\" style=\"color:#FFFFFF; font-size:11px; text-decoration:none\"><img src=\"http://www.someapp.com/media/img/facebook.png\" style=\"-ms-interpolation-mode:bicubic; text-decoration:none; border:none; outline:none; margin-right:3px\">follow us</a>\n                </div>\n              </td>\n            </tr>\n            <tr><td height=\"10\" colspan=\"3\" style=\"line-height:5px\">&#160;</td></tr>\n            <tr><td height=\"8\" colspan=\"3\" bgcolor=\"#E8711B\" style=\"line-height:5px\">&#160;</td></tr>\n            <tr><td height=\"30\" colspan=\"3\" bgcolor=\"#FFFFFF\">&#160;</td></tr>\n            </table>\n            <!-- Header Ends -->\n          </td>\n        </tr>\n        <tr>\n          <td width=\"85\">&#160;</td>\n          <td>\n            \n<h1 style=\"color:#353535; font-size:24px; font-family:helvetica, arial, sans-serif; margin:16px 0; line-height:24px\">We found an error!</h1>\n<p style=\"color:#353535; font-size:16px; font-family:helvetica, arial, sans-serif; margin:30px 0 0; line-height:24px\">Search Engine: some-place.net</p>\n\n<p style=\"color:#353535; font-size:16px; font-family:helvetica, arial, sans-serif; margin:30px 0 0; line-height:24px\"><code>Couldn't find the feed: HTTP Error 404: Not Found. Check that you can access the feeds's url..</code></p>\n\n<p style=\"color:#353535; font-size:16px; font-family:helvetica, arial, sans-serif; margin:30px 0 0; line-height:24px\">Please contact us if you need help.</p>\n\n<p style=\"color:#353535; font-size:16px; font-family:helvetica, arial, sans-serif; margin:30px 0 0; line-height:24px\">Thank you!</p>\n\n          </td>\n          <td width=\"85\">&#160;</td>\n        </tr>\n        <tr><td colspan=\"3\" height=\"85\" bgcolor=\"#FFFFFF\">&#160;</td></tr>\n        <tr><td colspan=\"3\" height=\"12\" bgcolor=\"#1B1B1B\">&#160;</td></tr>\n        </table>\n\n      </td>\n    </tr>\n    <tr>\n      <td align=\"center\" height=\"62\">\n        \n<p style=\"color:#353535; font-size:9px; font-family:helvetica, arial, sans-serif; margin:0; line-height:24px\">To stop receiving these emails from someapp, edit your <a href=\"https://app.someapp.com/admin/config/notifications?search_engine_id=170\" style=\"color:#E8711B\">preferences</a></p>\n\n        <p style=\"color:#353535; font-size:9px; font-family:helvetica, arial, sans-serif; margin:0; line-height:24px\">&#169;2014 someapp - Alberto Alcocer, 10 - 28036 Madrid - Spain</p>\n      </td>\n    </tr>\n    </table>\n\n  </body>\n</html>\n",
      "metadata":{  
         "user":"USERID"
      },
      "subject":"[someapp] Error in some-place.net"
   },
   "key":"THE API KEY HERE"
}

If this is sent inside the task it raises a MandrillAPIError but if I send it through a HTTP client like Paw it works fine.

I don't understand what's happening. We send transactional e-mails through Mandrill with the same module and everything is working fine.

Any help will be appreciated. Thank you very much.

Mandrill templates not working with django-mailer

When using django-mailer queue as the email backend, email message attribute template_name isn't saved, so djrill fails to use the correct mandrill API call and uses a regular send method without using the template.

My settings:
EMAIL_BACKEND = 'django_mailer.smtp_queue.EmailBackend'
MAILER_EMAIL_BACKEND = 'djrill.mail.backends.djrill.DjrillBackend'

When using djrill as EMAIL_BACKEND directly, it works fine.

Would be great to add full support of django-mailer.

2.x: drop Django 1.3 support (and python 2.6 and 3.2)

The Django project discontinued support for Django 1.3 a while back.

As Djrill continues to support newer Django versions, it becomes cumbersome to maintain support for a large number of older versions.

Feedback from Djrill users is welcome.

Admin site override in django 1.7

The installation instructions for the admin site no longer work in Django 1.7 because the import order has changed.

My quick fix is to place the following lines at the bottom settings.py.

from django.contrib import admin
from djrill import DjrillAdminSite
admin.site = DjrillAdminSite()

There is probably a more correct location to do the admin.site override.

2.x Proposal [breaking]: Raise exception if Mandrill send status is rejected or invalid

If Mandrill's send call returns a status of "invalid" or "rejected" for every recipient a particular message, raise a new MandrillRecipientsRefused exception.

The intent is to parallel the behavior of Django's smtp.EmailBackend, which will raise an smtplib.SMTPRecipientsRefused error if all recipients for a particular message are rejected by the SMTP server.

This could cause a multiple-message send call to be interrupted mid-batch. (Which is how Django's SMTP backend currently behaves.)

In the fail_silently case, this will cause the message with all recipients refused to not be counted in the num_sent count, but allow any other messages in the batch to be sent. (Again, matching the SMTP backend's behavior.)

If only some of the recipients for a particular message are rejected, but some are accepted, no exception would be raised. (Same as SMTP backend.)

See additional discussion in #80.

Question: is there anyway to trap and redirect emails to a email address?

On our staging/test servers, we would like to be able to tell djrill to swap out the recipients of all messages with a trap mail address.

Right now, we have code in our app that does this switching in debug mode, but it would be great if there's a debug trap address in the djrill email backend that we can use instead.

Configure Djrill not to send error mails via Mandrill

Hi

After reading the docs and googling a bit. It doesn't seem possible to get Djrill to not send error mails.

I would like to send error mails via my normal SMTP server. I don't want error mails to count in my mandrill usage.

Real cc and bcc handling

Mandrill has added a new type flag to the send API to field, allowing support for actual cc and bcc addresses. (Previously, there was no cc option, and only a single bcc was allowed.)

Djrill should update its recipient handling to identify cc and bcc addresses properly to Mandrill.

Idea: add mandrill_id as property of EmailMessage in _send()

I'm interested in getting the _id that Mandrill returns when you call their send api.

I think them returning it is fairly new. Getting this value is useful because you can then directly query the status of that message without using a webhook.

Of course we can't return this value directly from DjrillBackend._send() because Django defines the signature of that method.

As an idea, what about adding either the id or the full response json to the message that was sent as a property, probably prefacing with 'djrill' for the sake of namespacing. It could be done by adding either:
message.djrill_mandrill_id = response.json()[0].get('_id', None)
or, for the full response (I like this better),
message.djrill_mandrill_response = response.json()[0]

just before the final return True in DjrillBackend._send

Then someone who wanted this value could do:

msg = ...
msg.send()
id = msg.djrill_mandrill_response.get('_id', None)

Thoughts? Happy to submit a pull request if this concept makes sense.

--Eric

'EmailMultiAlternatives' object has no attribute 'tags'

I have Djrill working on my local, staging, and productions environments. However, I just tried adding Tags to my email templates.

The emails still send on my local machine just fine and can be seen in Mandrill with the specified tag attached to them.

However, on my Heroku staging environment I get an error which reads "'EmailMultiAlternatives' object has no attribute 'tags'".

My requirements doc has the following lines in it:

mandrill>=1.0.6
djrill==0.6

and I can see that both packages are installed upon deployment of the code.

Does anyone have any ideas for this problem?

Thanks!

DeprecationWarning: django.utils.simplejson is deprecated

djrill/views.py:5 throws a DeprecationWarning when used with django trunk. The json module from the standard lib should be used instead.

This should probably be implemented with a try/except block, looking for the json module, if it throws an ImportError, use the django.utils.simplejson module.

should response with invalid status raise an exception?

Hi,

I am confused about when djrill will raise an exception when sending a message msg.send()

I had the case where the invalid status was returned but I missed them since there was no exception raised.

mandrill_response  = [
    {
        "email": "invalid_email",
        "status": "invalid",
        "_id": "3aba0cb7f7ce412c8ab740392caaaaaa",
        "reject_reason": null
    }
]

Is an Exception raised only if there is a connection error or if the status is error?
What about raising an exception when the status is invalid?

Thanks
Michael

Metadata not submitting properly

I have set up a number of metadata variables to send to Mandrill. I have registered these variables for indexing in Mandrill. However, the metadata isn't registering properly in Mandrill.

I'm trying to figure out if there's a way I can debug the Djrill code to physically see that the metadata is being sent properly.

Does anyone have any advice?

Example metadata code:

msg.metadata = { 'first_name': user.first_name, 'last_name': user.last_name }

Add requirements.txt to source

Maybe I'm looking in the wrong spot, but I can't find a list of dependencies to run the tests.

I believe it's just the following libraries:

  • Django
  • requests
  • mock

Suggestion: return Mandrill response from the _send method

Hi there,

I would like to know if it was possible to return the Mandrill API response rather than just a boolean from the _send method in the backend.

I'm building an email log on top of Djrill so it will be useful to log the status to be able to troubleshoot any possible error.

Please let me know if you think it could work.

Guillaume

Wrong "To" in emails generated by django.utils.log.AdminEmailHandler

After having my Django app running for a few months, I have generated a couple 404 reports. The issue is that they are not getting to me! I checked my MandrillApp logs, and it seems that this is what they are sending the emails to:

   "to": [
            {
                "email": "y",
                "name": ""
            },
            {
                "email": "y",
                "name": ""
            }
        ],

Which doesnt make sense as it does have the ADMINS, MANAGERS, and SERVER_EMAIL defined correctly according to the Django documentation. Maybe I'm doing something wrong, but according to the config for my logging prefs:

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'filters': {
        'require_debug_false': {
            '()': 'django.utils.log.RequireDebugFalse'
        }
    },
    'handlers': {
        'mail_admins': {
            'level': 'ERROR',
            'filters': ['require_debug_false'],
            'class': 'django.utils.log.AdminEmailHandler'
        }
    },
    'loggers': {
        'django.request': {
            'handlers': ['mail_admins'],
            'level': 'ERROR',
            'propagate': True,
        },
    }
}

It seems like it should be sending it properly. Any suggestions?

email with attachment

Hi devs,
I'm using mandrill with djrill to send mails to my users as well as sending some mails with attachment {excel files } about user statistics but I found that djrill silently ignores attachments as of now

Is there any way so that I can enable it in my case ?

thanks

DeprecationWarning: django.conf.urls.defaults is deprecated; use django.conf.urls instead

I am getting the warning because of these pieces -

/Users/Bibhas/Works/the-albums/venv/lib/python2.7/site-packages/djrill/__init__.py:
   39              # Django 1.3
   40              #noinspection PyDeprecation
   41:             from django.conf.urls.defaults import include, patterns, url
   42          for path, view, name, display_name in self.custom_views:
   43              urls += patterns('',

/Users/Bibhas/Works/the-albums/venv/lib/python2.7/site-packages/djrill/urls.py:
    2      from django.conf.urls import patterns, url
    3  except ImportError:
    4:     from django.conf.urls.defaults import patterns, url
    5  
    6  from .views import DjrillWebhookView

Add link to AdminEmailHandler docs in "Mixing Email Backends"

I believe a common use case for using another email backend is for sending error emails to the admins.

Django's LOGGING configuration and the provided AdminEmailHandler support setting the email backend explicitly in the logging configuration.

Maybe you can put a link to django docs about this in "Mixing Email Backends" section of Djrill's documentation:

https://docs.djangoproject.com/en/dev/topics/logging/#django.utils.log.AdminEmailHandler

Just a thought :)

Add Mandrill integration tests (with test API key)

All Djrill's tests currently mock out the Mandrill API, and simply verify that Djrill is constructing the correct JSON to post to Mandrill (as it was documented at the time we implemented the feature).

This means we're not testing Djrill against the actual, current Mandrill API. Now that Mandrill has introduced test API keys, we could conceivably add some integration tests that communicate with the real API, in test mode.

This could add some robustness against Mandrill API changes (though those are unlikely to be breaking), and against our misreading the API docs (which, based on a sample of me, is far more likely).

Template content required

If you use a template for an email message, but do not specify template_content parameter in your EmailMessage object, then you receive an error from Mandrill API stating that you need to have template_content as a required parameter.

Djrill should, in the absence of template_content in the EmailMessage object, use an empty template_content as the parameter for the API request.

Currently, template_content is listed as an optional parameter for Djrill while it is a required parameter for Mandrill.

Fix Django 1.6 PendingDeprecationWarnings

New PendingDeprecationWarnings as of Django 1.6; need to be fixed before Django 1.8:

Test Runner
release-notes
PendingDeprecationWarning: The django.test._doctest module is deprecated; use the doctest module from the Python standard library instead.
PendingDeprecationWarning: The django.test.simple module and DjangoTestSuiteRunner are deprecated; use django.test.runner.DiscoverRunner instead.

Cycle Template Tag - used in Djrill admin pages
release-notes
PendingDeprecationWarning: The cycle template tag is changing to escape its arguments; the non-autoescaping version is deprecated. Load it from the future tag library to start using the new behavior.

asking for Mandrill Api url

Hi devs,
I'm trying to use mandrill for my transaction emails and was trying to setup the djrill library for my use.
I got this error where eclipse is saying that

raise ImproperlyConfigured("You have not added the Mandrill api "
ImproperlyConfigured: You have not added the Mandrill api url to your settings.py

I have added these two lines in my settings.py
MANDRILL_API_KEY = "581525fa-90b8-46ca-99a5-c3d9ef184a9b"
EMAIL_BACKEND = "djrill.mail.backends.djrill.DjrillBackend"

what exactly is Mandrill api url ?

thanks

Admin TypeError

I am using latest version of Djrill with Django 1.7 on python 3.4. All admin routes are retruning :

the JSON object must be str, not 'bytes'

Any idea whats wrong?

Upgrading djrill overwrites existing Django version

Even though it's technically required, specifying Django in the install_requires in the setup.py causes pip to overwrite an existing Django installation when upgrading djrill.

E.g., I'm running Django 1.5.5 for a production app, and running

pip install djrill -U

upgrades djrill (as it should), but also updates Django to 1.6.1, which I did not want it to do. Could we remove django from the install_requires?

Receiving Emails

Are there any plans to add support for receiving emails? I am willing to work on this.

Add documentation for Heroku

Mandrill is available as a Heroku add-on. Could you possibly provide some information regarding using Djrill on that platform.

You said in your documentation that we should "be sure to use a from_email that's in one of your Mandrill approved sending domains, or the message won't get sent". Their Heroku docs doesn't say anything about approved domains, but the example[1] uses a 'heroku.com' domain.

Does it mean that I can use any '*@heroku.com' from address if my app URL is a heroku subdomain and I can use any *@.com if my app is on a cusom domain? How can I set DEFAULT_FROM_EMAIL correctly?

[1] https://devcenter.heroku.com/articles/mandrill#example

django 1.7b4

Exception Type: MandrillAPIError
Exception Value:

Mandrill API response 500
Failed to send a message to [{'name': '', 'type': 'to', 'email': '[email protected]'}], from [email protected]

Exception Location: /home/evgen/git/clever3.3/lib/python3.3/site-packages/djrill/mail/backends/djrill.py in _send, line 119

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.