Skip to content

ecarreras/mandrill_webhooks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mandrill Webhooks

Flattr this repo

Simple Flask extension to register functions to a mandrill hook

from flask import Flask
from mandrill_webhooks import MandrillWebhooks

app = Flask(__name__)
mandrill = MandrillWebhooks(app)

@mandrill.hook('open')
def open_event(payload):
    """This code will be raised when open."""
    print "Open event received!"


@mandrill.hook('*')
def wildcard(payload, event):
    """This code will be raised for every event."""
    print "Event %s received!" % event


# You can have more than one function for the same event

@mandrill.hook('open')
def another_open_event(payload):
    """This is another event code."""
    pass

About

Flask blueprint to integrate Mandrill Webhooks

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages