Adds SendGrid support to Flask applications
Project description
Flask plugin for sending emails with SendGrid.
Provides full support for all Twilio SendGrid Web API v3 endpoints, including v3 /mail/send.
Installation
pip install flask-sendgrid
Usage
from flask_sendgrid import SendGrid
app = Flask(__name__)
app.config['SENDGRID_API_KEY'] = 'your api key'
app.config['SENDGRID_DEFAULT_FROM'] = 'admin@yourdomain.com'
mail = SendGrid(app)
# send multiple recipients; backwards compatible with Flask-Mandrill
mail.send_email(
from_email='someone@yourdomain.com',
to_email=[{'email': 'test1@example.com'}, {'email': 'test2@example.com'}],
subject='Subject'
text='Body',
)
# send single recipient; single email as string
mail.send_email(
from_email='someone@yourdomain.com',
to_email='test@example.com',
subject='Subject'
text='Body',
)
# send single recipient; single email as sendgrid.mail.helpers.Email object
mail.send_email(
from_email='someone@yourdomain.com',
to_email=Email('test@example.com'),
subject='Subject'
text='Body',
)
# send multiple recipients; list of emails as sendgrid.mail.helpers.Email object
mail.send_email(
from_email='someone@yourdomain.com',
to_email=[Email('test1@example.com'), Email('test2@example.com')],
subject='Subject'
text='Body',
)
For additional information about mail parameters: SendGrid Web API Mail
Release History
0.5.12 (2016-1-3)
another maintenance release
0.5.1 (2016-1-3)
maintenance release
0.5.0 (2016-1-2)
Upgrading to support SendGrid API v3
0.1.0 (2016-03-30)
First release.
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-SendGrid-0.7.1.tar.gz
(4.1 kB
view details)
Built Distributions
File details
Details for the file Flask-SendGrid-0.7.1.tar.gz
.
File metadata
- Download URL: Flask-SendGrid-0.7.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.4.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | be081d350fca7433655aa8e6b789000a0f673b7bfda8cb72eea20bb55e09051f |
|
MD5 | 7e298c2c34f45df319e3e0e7ba31ce9a |
|
BLAKE2b-256 | 07bae8005aec6e1ad74f8b920aa9ce99912ed81c89c72a4b6b35f5ba98989079 |
File details
Details for the file Flask_SendGrid-0.7.1-py3-none-any.whl
.
File metadata
- Download URL: Flask_SendGrid-0.7.1-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.4.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f81ecad0cbbdd28d8750e1db43bb683ea18a16b4f96af82fdb2857d9a402020 |
|
MD5 | d8f783d43fb2bf55ad5b4aab89051375 |
|
BLAKE2b-256 | c8b96cade7727a53dc7cc2da6a6197705de980715af12e480495f9865c7bc07c |
File details
Details for the file Flask_SendGrid-0.7.1-py2-none-any.whl
.
File metadata
- Download URL: Flask_SendGrid-0.7.1-py2-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6892fa41cc038cbab41bab12e9cce3cddbfe504362ca527f5823dabb2bfa8d4 |
|
MD5 | 121f0194ccdbcec48af2287bb400b503 |
|
BLAKE2b-256 | d7b03f60f769df54eb7b76b55ae9a225a7064a7830eb3549099b4f8462320d77 |