Skip to content

Commit

Permalink
feat: Add Mandrill Subaccount support
Browse files Browse the repository at this point in the history
  • Loading branch information
amirtds committed Jan 27, 2024
1 parent 8ee7fb4 commit 3022eb7
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,22 @@ def plugin_settings(settings):
"MANDRILL_API_KEY": settings.MANDRILL_API_KEY,
}
settings.INSTALLED_APPS += ['anymail']

# Mandrill Subaccount Support
settings.MANDRILL_SUBACCOUNT = settings.ENV_TOKENS.get("MANDRILL_SUBACCOUNT")
if settings.MANDRILL_SUBACCOUNT:
subaccount_settings = {
"MANDRILL_SEND_DEFAULTS": {
"esp_extra": {
"message": {
"subaccount": settings.MANDRILL_SUBACCOUNT
}
}
}
}
if settings.ANYMAIL:
settings.ANYMAIL.update(subaccount_settings)
else:
settings.ANYMAIL = subaccount_settings
# Sentry
settings.SENTRY_DSN = settings.AUTH_TOKENS.get('SENTRY_DSN', False)
if settings.SENTRY_DSN:
Expand Down

0 comments on commit 3022eb7

Please sign in to comment.