aiohttp-sendgrid
SendGrid mail API wrapper
Installation
pip install aiohttp_sendgrid
Usage
Create an instance of API client:
import asyncio
from aiohttp_sendgrid import Sendgrid
api_key = '<your_sendgrid_api_key>'
mailer = Sendgrid(api_key=api_key)
Important to note that if api_key is not provided then it will try to read SENDGRID_API_KEY environment variable
Send email to single recipient
to = 'to@example.com'
sender = 'from@example.com'
subject = 'greetings'
content = '<h1>Hello</h1>'
send_mail = mailer.send(to, sender, subject, content)
loop = asyncio.get_event_loop()
loop.run_until_complete(send_mail)
Both to and sender might be also a dictionary with email key, if you want to specify name for sender or recipient then add name key to the dictionary. Thus, to = {'email': 'to@example.com', 'name': 'Recipient'} is also a correct value.
Send single email to multiple recipients
to = ['to@example.com', 'another@example']
sender = 'from@example.com'
subject = 'greetings'
content = '<h1>Hello</h1>'
send_mail = mailer.send(to, sender, subject, content)
loop = asyncio.get_event_loop()
loop.run_until_complete(send_mail)
to might be tuple or list of strings or dictionaries.
Metadata
Release files for aiohttp-sendgrid 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aiohttp_sendgrid-0.0.4.tar.gz | 5.0 kB | Without provenance | Details for aiohttp_sendgrid-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aiohttp_sendgrid-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for aiohttp_sendgrid-0.0.4-py3-none-any.whl |
Total release size: 11.2 kB
Release files / aiohttp_sendgrid-0.0.4.tar.gz
| Download URL | aiohttp_sendgrid-0.0.4.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ed966f5ea95c2dcb324577befb58ef62e6ff3b70b4781e43a880aa1a02027675
|
|
BLAKE2b-256 checksum How to use checksums |
741f2f9c6a3b254440d904af87fa0e3ce9fb73b6dff84fce3ef050a79b8b90b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / aiohttp_sendgrid-0.0.4-py3-none-any.whl
| Download URL | aiohttp_sendgrid-0.0.4-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7c7a735b3e92426c3a3afd49340317c4651d22799759ced1fbb9323de3f9799c
|
|
BLAKE2b-256 checksum How to use checksums |
d968621c2a9bee8c45240bf435e54bb04a3a75ddafb5e1fff9614df4b4c352bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for aiohttp-sendgrid 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.