def inbound_parse(): parse = Parse(config, request) # Sample proccessing action print(parse.key_values()) # Tell SendGrid's Inbound Parse to stop sending POSTs # Everything is 200 OK :) return "OK"
def inbound_parse(): """Process POST from Inbound Parse and print received data.""" parse = Parse(config, request) # Sample processing action print(parse.key_values()) # Tell SendGrid's Inbound Parse to stop sending POSTs # Everything is 200 OK :) return "OK"
def inbound_parse(): """Process POST from Inbound Parse and save received data.""" parse = Parse(config, request) # Sample proccessing action updata = parse.key_values() if ("kmahyyg" in updata['to']): yygdata = json.dumps(updata) YYGFile.write(yygdata) YYGFile.close() elif ("ecswvern" in updata['to']): ecsdata = json.dumps(updata) ECSFile.write(ecsdata) ECSFile.close() else: spamdata = json.dumps(updata) SpamFile.write(spamdata) SpamFile.close() # Tell SendGrid's Inbound Parse to stop sending POSTs # Everything is 200 OK :) # Now send the corresponding file to each chat id return jsonify({'status': 200, 'bmsg': 'OK'})