Skip to content

Instantly share code, notes, and snippets.

@CrimsonScythe
Last active November 30, 2021 17:08
Show Gist options
  • Save CrimsonScythe/43bc79e6d77649307f1688850edad65b to your computer and use it in GitHub Desktop.
Save CrimsonScythe/43bc79e6d77649307f1688850edad65b to your computer and use it in GitHub Desktop.
from flask import Flask, request, jsonify
from mailasync import sendMail
app = Flask(__name__)
@app.route('/api/send', methods=['GET', 'POST'])
def send():
data = request.get_json()
sendMail.delay(data)
return jsonify({"response:": "ok"})
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0', port=5000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment