Skip to main content

SendGrid mail send API wrapper

Project description

aiohttp-sendgrid
================
.. 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

Installation
------------
``pip install aiohttp_sendgrid``

Send email to single recipient
-------------------------------
.. code:: python

import asyncio
from aiohttp_sendgrid import Sendgrid
mailer = Sendgrid()
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)

Send single email to multiple recipients
----------------------------------------
.. code:: python

import asyncio
from aiohttp_sendgrid import Sendgrid
mailer = Sendgrid()
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)


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

aiohttp_sendgrid-0.0.3.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

aiohttp_sendgrid-0.0.3-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page