Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (testpypi.python.org).
Help us improve Python packaging - Donate today!

Send email using Mailgun with Mailgun specific attributes.

Project Description

Send email using Mailgun with Mailgun specific attributes.

It also includes an API-compatible send_mail function that allows you to pass custom Mailgun-specific attributes when sending email including:

  • campaign
  • deliverytime
  • dkim
  • track
  • tracking clicks
  • tracking opens
  • tags

Quick start

  1. Add “postgun” to INSTALLED_APPS:
INSTALLED_APPS = (
  ...
  'postgun'
)
  1. Add the following settings to your settings.py:
EMAIL_BACKEND = 'postgun.backends.MailgunEmailBackend'
MAILGUN_DOMAIN = 'example.com'
MAILGUN_API_KEY = 'key-my-api-key'
MAILGUN_PUBLIC_KEY = 'pubkey-my-public-key' #Only needed for email validation

Sending Email

from postman import send_mail
send_mail('Test Email',  #subject
      'This is your test message.', #text content
      'admin@example.com',  #from address
      ['james@example.com', ],  #recipients
      html_message='This is your <strong>test</strong> message.', #html (optional)
      campaign='test',  #Mailgun campaign id
      tags=['testing', 'august', 'beta'],  #Mailgun tags - 3 max
      reply_to='jacob@example.com') #Reply to address

Validating Email

Validate email checks against the Mailgun validation API to see if an address is valid.

If an address is invalid and there are no suggestions a ValidationError is raised. If an address is invalid and there are suggestions a ValidationError is raised with the suggestion in the message. Returns True on valid email or ConnectionError, AttributeErrors

from postman.validators import validate_email_mailgun
is_valid = validate_email_mailgun('james@hotmail.co.uk')
Release History

Release History

This version
History Node

0.1

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-postgun-0.1.tar.gz (12.9 kB) Copy SHA256 Checksum SHA256 Source Aug 13, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting