Skip to main content

Mailgun client for python

Project description

mailgun3_python

Python client for mailgun.

Documentation Status

For detail:

Install

pip install mailgun3_python

Set API KEY from docsumo setting page as env variable MAILGUN_API_KEY & MAILGUN_DOMAIN or pass apikey parameter in Mailgun class.

export MAILGUN_API_KEY="key-c-fgrt456" >>  ~/.bashrc
export MAILGUN_DOMAIN="example.com" >>  ~/.bashrc
source ~/.bashrc

Example

from mailgun import Mailgun

mailgun = Mailgun()

# send email with attachment 
mailgun.send_message("Text, <test@gmail.com>", 
                    "bkrm.dahal@gmail.com", 
                    "Docsumo: Automate invoice data capture at Docsumo", 
                    'Hi, welcome to docsumo.', 
                    files=['./invoice.pdf'])

# send message with saved template
mailgun.send_message_template("Text, <test@gmail.com>", 
                                "bkrm.dahal@gmail.com", 
                                "Docsumo: Automate invoice data capture at Docsumo", 
                                "welcome_email", 
                                {"company_name": "docsumo", "first_name": "bikram"})

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

mailgun3_python-0.1.4.tar.gz (4.9 kB view hashes)

Uploaded Source

Built Distribution

mailgun3_python-0.1.4-py3-none-any.whl (6.6 kB view hashes)

Uploaded Python 3

Supported by

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