mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 11:51:05 -05:00
add subaccount support to djrill
This commit is contained in:
@@ -49,6 +49,8 @@ class DjrillBackend(BaseEmailBackend):
|
||||
super(DjrillBackend, self).__init__(**kwargs)
|
||||
self.api_key = getattr(settings, "MANDRILL_API_KEY", None)
|
||||
self.api_url = MANDRILL_API_URL
|
||||
|
||||
self.subaccount = getattr(settings, "MANDRILL_SUB_ACCOUNT", None)
|
||||
|
||||
if not self.api_key:
|
||||
raise ImproperlyConfigured("You have not set your mandrill api key "
|
||||
@@ -187,6 +189,10 @@ class DjrillBackend(BaseEmailBackend):
|
||||
'tags', 'preserve_recipients', 'view_content_link', 'subaccount',
|
||||
'google_analytics_domains', 'google_analytics_campaign',
|
||||
'metadata']
|
||||
|
||||
if self.subaccount:
|
||||
msg_dict['subaccount'] = self.subaccount
|
||||
|
||||
for attr in mandrill_attrs:
|
||||
if hasattr(message, attr):
|
||||
msg_dict[attr] = getattr(message, attr)
|
||||
|
||||
Reference in New Issue
Block a user