Skip to content
Flask extension for Pystmark
Python
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
test
.coveragerc
.gitignore
.readthedocs.yml
.travis.yml
LICENSE
MANIFEST.in
README.md
README.rst
__about__.py
flask_pystmark.py
requirements.txt
setup.py

README.md

Flask-Pystmark

PyPI version Build Status Coverage Status

Flask extension for Pystmark, a Postmark API library.

Flask-Pystmark supports Python 2.7, 3.6 and PyPy.

Read the complete docs

To run the tests, do python setup.py test

Example:

# app.py
from flask import Flask
from flask_pystmark import Pystmark, Message
from pystmark import ResponseError

app = Flask(__name__)
app.config['PYSTMARK_API_KEY'] = 'your_api_key'
app.config['PYSTMARK_DEFAULT_SENDER'] = 'admin@example.com'
pystmark = Pystmark(app)

@app.route('/')
def send():
    m = Message(to='user@gmail.com', text='Welcome')
    resp = pystmark.send(m)
    try:
        resp.raise_for_status()
    except ResponseError as e:
        return 'Failed to send message. Reason: {}'.format(e)
    else:
        return 'Sent message to {}'.format(resp.message.to)
You can’t perform that action at this time.