Flask extension for sendgrid. It has same interface with Flask-Mail.
Project description
Flask-Mail-SendGrid
===================
Installing Flask-Mail-SendGrid
------------------------------
Install with pypi:
.. code:: bash
$ pip install flask-mail-sendgrid
or install latest version:
.. code:: bash
$ 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
-----
.. code:: python
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:
.. code:: python
msg.body = "testing"
msg.html = "<b>testing</b>"
Finally, to send the message, you use the Mail instance configured with your Flask application:
.. code:: python
mail.send(msg)
===================
Installing Flask-Mail-SendGrid
------------------------------
Install with pypi:
.. code:: bash
$ pip install flask-mail-sendgrid
or install latest version:
.. code:: bash
$ 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
-----
.. code:: python
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:
.. code:: python
msg.body = "testing"
msg.html = "<b>testing</b>"
Finally, to send the message, you use the Mail instance configured with your Flask application:
.. code:: python
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
Close
Hashes for Flask-Mail-SendGrid-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9000be5265d7f56788e0b2a737334e88cfce240deaf0ba7c3f630325949621e1 |
|
MD5 | 651f56c75caf783df201e738bd6672a6 |
|
BLAKE2b-256 | 4a6236726814e084e30d9580e84ed3e36ffa12ec1916c710ecf4c97c9e3eadd4 |