Welcome to Flask-Postmark’s documentation!

This is a simple integration with Postmark for Flask applications.

To send an email in your Flask application:

from flask import Flask
from flask_postmark import Postmark

app = Flask(__name__)
app.config["POSTMARK_SERVER_TOKEN"] = "<replace with your server token>"

postmark = Postmark(app)


@app.route("/send", methods=["POST"])
def send():
    postmark.send(
        From="sender@example.com",
        To="receiver@example.com",
        Subject="Postmark test",
        HtmlBody="""
            <html>
            <body>
            <strong>Hello</strong> dear Postmark user.
            </body>
            </html>""",
    )
    return b"OK"

Changelog

0.3.1 - 2020-08-29

Fixed

  • Documentation on Read The Docs

0.3.0 - 2020-08-29

Added

  • Type annotations.

Changed

  • Raise RuntimeError if context stack is empty when you try to use Postmark.client.

Removed

  • Support for Python 2.6, 2.7, 3.3, 3.4.

0.2.0 - 2017-06-10

Added

  • Register the extension on the app. #6
  • Use self.app as a fallback. #5

0.1.0 - 2017-05-11

  • Initial release.

Indices and tables