For the complete documentation index, see llms-docs.txt or the site index llms.txt. Full docs corpus: llms-full-docs.txt. Prefer the markdown version of this page at /docs/examples/python/flask.md. Product capabilities: skill.md. Docs MCP: /docs/mcp. Site MCP: /mcp.

Flask

Learn how to integrate Reloop with Flask to send emails.

Flask Integration

Integrate Reloop into your Flask application.

Installation

pip install reloop-email

Sending an Email

import os
from flask import Flask, jsonify
from reloop_email import Reloop

app = Flask(__name__)
reloop = Reloop(api_key=os.environ.get("RELOOP_API_KEY"))

@app.route("/send-email", methods=["POST"])
def send_email():
    try:
        result = reloop.mail.send({
            "from": "onboarding@reloop.sh",
            "to": "delivered@resend.dev",
            "subject": "Hello from Flask",
            "html": "<p>Congrats on sending your first email via Reloop from Flask!</p>",
        })
        if result.email_error:
            raise result.email_error
        return jsonify(result.response)
    except Exception as e:
        return jsonify({"error": str(e)}), 500

if __name__ == "__main__":
    app.run(port=5000)

Was this page helpful?

Edit this page