All Projects → jpadilla → mandrill-inbound-python

jpadilla / mandrill-inbound-python

Licence: MIT license
Python Wrapper for Mandrill Inbound Email

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to mandrill-inbound-python

mailchimp-transactional-node
The official Node.js client library for the Mailchimp Transactional API
Stars: ✭ 30 (+50%)
Mutual labels:  mandrill
keystone-email
⚠️ Archived - Legacy email helper for KeystoneJS Apps
Stars: ✭ 30 (+50%)
Mutual labels:  mandrill
MailHookBundle
A bundle to catch API webhook from different mail service
Stars: ✭ 36 (+80%)
Mutual labels:  mandrill
silverstripe-mandrill
Mandrill integration for Silverstripe
Stars: ✭ 17 (-15%)
Mutual labels:  mandrill
Email Templates
📫 Create, preview, and send custom email templates for Node.js. Highly configurable and supports automatic inline CSS, stylesheets, embedded images and fonts, and much more!
Stars: ✭ 3,291 (+16355%)
Mutual labels:  mandrill
magento2-mandrill
Mandrill integration for Magento 2.
Stars: ✭ 35 (+75%)
Mutual labels:  mandrill
SlmMail
Send mail from Laminas or Mezzio using external mail services.
Stars: ✭ 107 (+435%)
Mutual labels:  mandrill
mailchimp-transactional-python
The official Python client library for the Mailchimp Transactional API
Stars: ✭ 26 (+30%)
Mutual labels:  mandrill
mailchimp-transactional-php
The official PHP client library for the Mailchimp Transactional API
Stars: ✭ 24 (+20%)
Mutual labels:  mandrill
go-mail
📨 Simple email interface across multiple service providers (ses, postmark, mandrill, smtp)
Stars: ✭ 39 (+95%)
Mutual labels:  mandrill

Mandrill Inbound Python Wrapper Build Status

This is a simple API wrapper for Mandrill's inbound email webhook in Python inspired by this other Python wrapper library I made for Postmark Inbound.

Install

Using Github:

git clone git://github.com/jpadilla/mandrill-inbound-python.git

Using pip:

pip install python-mandrill-inbound

Using easy_install:

easy_install python-mandrill-inbound

Usage

from mandrill_inbound import MandrillInbound


# Load from JSON string
json_data = open('./tests/fixtures/valid_http_post.json').read()
inbound = MandrillInbound(json=json_data)

# Load Python dictionary
json_data = json.loads(open('./tests/fixtures/valid_http_post.json').read())
inbound = MandrillInbound(source=json_data)

# Content
print inbound.subject
print inbound.sender
print inbound.to
print inbound.cc
print inbound.recipients
print inbound.message_id
print inbound.mailbox_hash
print inbound.html_body
print inbound.text_body
print inbound.send_date
print inbound.ts

# Spam and Spoofing Detection
print inbound.spf
print inbound.dkim
print inbound.spam_score

# headers
print inbound.headers  # default to get all headers
print inbound.headers['MIME-Version']
print inbound.headers['Received-SPF']

# attachments
print inbound.has_attachments # boolean
attachments = inbound.attachments

first_attachment = attachments[0]
print first_attachment.name

second_attachment = attachments[1]
print second_attachment.content_length

for a in attachments:
	print a.name
	print a.content_type
	print a.read()
	print a.download('./tests/', ['image/png'])

# raw data
print inbound.source
print inbound.msg

Bug tracker

Have a bug? Please create an issue here on GitHub!

Contributions

  • Fork
  • Write tests
  • Write Code
  • Pull request

Thanks for your help.

License

MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].