Skip to main content

Mandrill transactional email for Django

Project description

Djrill integrates the Mandrill transactional email service into Django.

This is a fork of the inactive brack3t’s Djrill.

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 4.0-5.2. Djrill uses semantic versioning.

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 = "you@example.com"  # 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 <djrill@example.com>", ["to@example.com"])

    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 <djrill@example.com>",
        to=["Recipient One <someone@example.com>", "another.person@example.com"],
        headers={'Reply-To': "Service <support@example.com>"} # 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

djrill_fork-2.2.0.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

djrill_fork-2.2.0-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file djrill_fork-2.2.0.tar.gz.

File metadata

  • Download URL: djrill_fork-2.2.0.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.2

File hashes

Hashes for djrill_fork-2.2.0.tar.gz
Algorithm Hash digest
SHA256 a9910bf381373c056fd40deec247f65b0c6564223a4dcdeba3191e9056b17893
MD5 034148a5452311064aa06bd8599d7b97
BLAKE2b-256 cee2edf290b7e9a043de93e8926a2e147485e19ff1c337a7264c8ac79f69eed7

See more details on using hashes here.

File details

Details for the file djrill_fork-2.2.0-py3-none-any.whl.

File metadata

  • Download URL: djrill_fork-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.2

File hashes

Hashes for djrill_fork-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a8b532d38e17f0b5ea5289af4b2c723ca2001e823c61fbe6ac2fafb77ff9244c
MD5 225732e3bd262009ffbe1383f9f65f0f
BLAKE2b-256 8248de9711d5290ab3c6f83784784a1993cf8e8756d2dd03274d694fbb647e1f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page