Flask extension for sendgrid. It has same interface with Flask-Mail.
Project description
Flask-Mail-SendGrid
===================
# 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("Subject",
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)
~~~
===================
# 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("Subject",
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file Flask-Mail-SendGrid-0.1.1.tar.gz
.
File metadata
- Download URL: Flask-Mail-SendGrid-0.1.1.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f850fa41440ac4824084ad6a9bf604180103239f47f5b1d1cd9c921064c920c3 |
|
MD5 | ac2d79a951dc707e3fb49e118c3c1551 |
|
BLAKE2b-256 | 77ede38039cd397f8f40540f201dfd97d0b45cd305624c1d9e46d2e602016287 |