Skip to content

Instantly share code, notes, and snippets.

@j4mie
Created December 7, 2010 00:31
Show Gist options
  • Save j4mie/731263 to your computer and use it in GitHub Desktop.
Save j4mie/731263 to your computer and use it in GitHub Desktop.
Send push notifications from GAE with Flask and Notifo
from flask import Flask, request
from google.appengine.api.mail import InboundEmailMessage
import notifo
from config import NOTIFO_USER, NOTIFO_KEY
app = Flask(__name__)
@app.route("/_ah/mail/<address>", methods=['POST'])
def receive_mail(address):
message = InboundEmailMessage(request.data)
notifo.send_notification(NOTIFO_USER, NOTIFO_KEY, NOTIFO_USER, message.subject, 'pushhandler')
return 'OK'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment