Parses incoming Sendgrid Webhooks in Pyramid apps
Python Makefile
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
pyramid_sendgrid_webhooks
tests
.editorconfig
.gitignore
.travis.yml
AUTHORS.rst
CONTRIBUTING.rst
HISTORY.rst
LICENSE
MANIFEST.in
Makefile
README.rst
requirements_dev.txt
setup.cfg
setup.py
tox.ini
travis_pypi_setup.py

README.rst

Pyramid Sendgrid Webhooks

Documentation Status

Parses incoming Sendgrid Webhooks in Pyramid apps

Features

To use this app, add a configuration statement with your intended webhook callback path:

config.include('pyramid_sendgrid_webhooks', '/sendgrid/webhooks')

Then, set up subscribers for any events that you want to be notified of:

from pyramid_sendgrid_webhooks import events

def handle_bounce(event):
    request = event.request
    print event.reason

...
config.add_subscriber(handle_bounce, events.BounceEvent)

Currently the app adds a single endpoint at {PREFIX}/receive. This will be the webhook path to give to Sendgrid. In the example above, the full endpoint would therefore be at /sendgrid/webhooks/receive.

Credits

Tools used in rendering this package: