Flask plugin to simplify sending emails through Mandrill.
pip install flask-mandrill
from flask.ext.mandrill import Mandrill
app = Flask(__name__)
app.config['MANDRILL_API_KEY'] = 'your api key'
app.config['MANDRILL_DEFAULT_FROM'] = '[email protected]'
mandrill = Mandrill(app)
mandrill.send_email(
from_email='[email protected]',
subject='Subject',
to=[{'email': '[email protected]'}, {'email': '[email protected]'}],
text='Hello World'
)
To use a templated e-mail, specify template_name='some template name as an argument.
For additional information about send_email parameters: https://mandrillapp.com/api/docs/messages.html