
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
.. image:: https://travis-ci.org/Kurlov/aiohttp-sendgrid.svg?branch=master :target: https://travis-ci.org/Kurlov/aiohttp-sendgrid .. image:: https://badge.fury.io/py/aiohttp-sendgrid.svg :target: https://badge.fury.io/py/aiohttp-sendgrid
SendGrid mail API wrapper
pip install aiohttp_sendgrid
Create an instance of API client:
.. code:: python
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
.. code:: python
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.
.. code:: python
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.
FAQs
SendGrid mail send API wrapper
We found that aiohttp-sendgrid demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.