Skip to main content

Flask extension for sendgrid. It has same interface with Flask-Mail.

Project description

Installing Flask-Mail-SendGrid

Install with pypi:

$ pip install flask-mail-sendgrid

or install latest version:

$ git clone https://github.com/hamano/flask-mail-sendgrid.git
$ cd flask-mail-sendgrid
$ python setup.py install

Configuring Flask-Mail-SendGrid

  • SENDGRID_API_KEY: API Key for SendGrid

  • MAIL_DEFAULT_SENDER: default sender

Usage

from flask_mail_sendgrid import MailSendGrid
mail = MailSendGrid(app)

msg = Message("Hello",
              sender="from@example.com",
              recipients=["to@example.com"])

The message can contain a body and/or HTML:

msg.body = "testing"
msg.html = "<b>testing</b>"

Finally, to send the message, you use the Mail instance configured with your Flask application:

mail.send(msg)

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

Flask-Mail-SendGrid-0.1.3.tar.gz (2.4 kB view details)

Uploaded Source

File details

Details for the file Flask-Mail-SendGrid-0.1.3.tar.gz.

File metadata

File hashes

Hashes for Flask-Mail-SendGrid-0.1.3.tar.gz
Algorithm Hash digest
SHA256 0ae9b5f28576f2db9b3ada4b97c53c4aef28195bfefeae86520aa9d876709918
MD5 e2cccc6baf3c1901c338e6b29a029680
BLAKE2b-256 8c0ff7768c3145acb036fbfebf4b55d957965e179e45b239eefc5d631899397e

See more details on using hashes here.

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