Connect Stacosys to SRMail

This commit is contained in:
Yax 2015-05-16 10:59:44 +02:00
parent a525c4de19
commit 99b2eb3628
4 changed files with 29 additions and 1 deletions

25
app/controllers/mail.py Normal file
View file

@ -0,0 +1,25 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from flask import request, jsonify, abort
from app import app
from app.services import processor
logger = logging.getLogger(__name__)
@app.route("/inbox", methods=['POST'])
def new_mail():
try:
data = request.get_json()
logger.info(data)
processor.enqueue({'request': 'new_mail', 'data': data})
except:
logger.exception("new mail failure")
abort(400)
return "OK"