diff --git a/mail.py b/mail.py index 22a6c15..49bb95f 100644 --- a/mail.py +++ b/mail.py @@ -7,6 +7,20 @@ from flask import jsonify import os +# This is used to send emails via API +# The process should be something like this +# curl --request POST \ +# --url https://nathan.c.woodburn.au/api/email \ +# --header 'Content-Type: application/json' \ +# --data '{ +# "key":"api-key", +# "to": "recipient@nathan.woodburn.au", +# "from": "sender@nathan.woodburn.au", +# "sender":"Nathan.Woodburn/", +# "subject":"Test email from api", +# "body":"G'\''day\nThis is a test email from my website api\n\nRegards,\nNathan.Woodburn/" +# }' + def validateSender(email): domains = os.getenv("EMAIL_DOMAINS").split(",") for domain in domains: diff --git a/server.py b/server.py index be0d8eb..e2d5a9f 100644 --- a/server.py +++ b/server.py @@ -411,11 +411,8 @@ def email(): "status": 401, "error": "Unauthorized 'key' invalid" }) - - return sendEmail(data) - #endregion @@ -673,6 +670,8 @@ def now_old(): ) @app.route("/now.rss") +@app.route("/now.xml") +@app.route("/rss.xml") def now_rss(): host = "https://" + request.host if ":" in request.host: