Python client for mailgun.
For detail:
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
from mailgun import Mailgun
mailgun = Mailgun()
# send email with attachment
mailgun.send_message("Text, <[email protected]>",
"[email protected]",
"Docsumo: Automate invoice data capture at Docsumo",
'Hi, welcome to docsumo.',
files=['./invoice.pdf'])
# send message with saved template
mailgun.send_message_template("Text, <[email protected]>",
"[email protected]",
"Docsumo: Automate invoice data capture at Docsumo",
"welcome_email",
{"company_name": "docsumo", "first_name": "bikram"})