Python
Latest commit e320708 Jan 12, 2015 @RyanBalfanz Merge pull request #71 from nitr0man/develop
fix Django 1.6 compatibility
Permalink
Failed to load latest commit information.
example_project Removed max_length from categories field Dec 4, 2012
sendgrid fix Django 1.6 compatibility Dec 7, 2014
.gitignore Ignored docs/_build/* Mar 8, 2012
MANIFEST.in Added missing initial_data.json to source distribution Sep 17, 2012
README.rst Fixed #62; Added note about migrations Jul 9, 2013
fabfile.py Merged pre-existing deploy tasks to develop fabfile Jul 18, 2012
requirements.txt
setup.py Added install_requires argument to setup() Sep 19, 2012

README.rst

django-sendgrid

https://pypip.in/d/django-sendgrid/badge.png

Master Branch Build Status:

https://www.codeship.io/projects/64b8c9d0-8f52-0130-fe63-22000a95225b/status?branch=master

Develop Branch Build Status:

https://www.codeship.io/projects/64b8c9d0-8f52-0130-fe63-22000a95225b/status?branch=develop

django-sendgrid is the easiest way to send e-mail with SendGrid. It uses the SendGrid SMTP API, as recommended.

Although it's rather simple to use, a example project is included to demonstrate usage.

Installation

To install with PyPi:

pip install django-sendgrid

Usage

Add sendgrid to your INSTALLED_APPS:

INSTALLED_APPS = (
        # Existing apps
        "sendgrid",
)

Add the following to your settings:

SENDGRID_EMAIL_HOST = "smtp.sendgrid.net"
SENDGRID_EMAIL_PORT = 587
SENDGRID_EMAIL_USERNAME = "your_sendgrid_username"
SENDGRID_EMAIL_PASSWORD = "your_sendgrid_password"

Don't forget to migrate:

python manage.py migrate sendgrid

The API is similar to that of Django's; create a SendGridEmailMessage and send it:

>>> from sendgrid.message import SendGridEmailMessage
>>> email = SendGridEmailMessage('Subject', 'Body', 'ryan@ryanbalfanz.net', ['ryan@ryanbalfanz.net'])
>>> email.send()

Additional Information

Preview

List View

https://s3.amazonaws.com/django-sendgrid/email_message_list.png

Detail View

https://s3.amazonaws.com/django-sendgrid/email_message_detail.png