Skip to content

Instantly share code, notes, and snippets.

@aaronromeo
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronromeo/cf0f613248cd38b3a4ed to your computer and use it in GitHub Desktop.
Save aaronromeo/cf0f613248cd38b3a4ed to your computer and use it in GitHub Desktop.
Using Mandrill headers with Django's email framework
from django.core.mail import EmailMessage
email = EmailMessage(
# subject='',
# body='',
from_email='from@example.com',
to=['to+1@example.com', 'to+2@example.com'],
bcc=['bcc@example.com'],
headers={
'X-MC-Template': 'template-slug',
'X-MC-MergeVars': '{"companyname": "Aaron\'s little email company", "INVOICETOTAL": "$59.99"}'
}
)
email.send()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment