Giter Site home page Giter Site logo

barseghyanartur / djrill Goto Github PK

View Code? Open in Web Editor NEW

This project forked from brack3t/djrill

0.0 3.0 0.0 936 KB

Djrill is an email backend and new message class for Django users that want to take advantage of the Mandrill transactional email service from MailChimp.

License: BSD 3-Clause "New" or "Revised" License

Python 91.63% HTML 8.37%

djrill's Introduction

Djrill: Mandrill Transactional Email for Django

Djrill integrates the Mandrill transactional email service into Django.

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
  • An optional Django admin interface

Djrill is released under the BSD license. It is tested against Django 1.3--1.8 (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

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

Watchers

James Cloos avatar Artur Barseghyan avatar  avatar

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.