Skip to main content

FastAPI Plugin Notification

A notification plugin for FastAPI that integrates with FastAPI SDK and Postmark provider to send notifications via email and store them in a database.

Features

  • 📧 Email Notifications: Send notifications via Postmark email provider
  • 💾 Database Storage: Store notifications in MongoDB using ODMantic
  • 🔐 User Ownership: Automatic ownership filtering based on user claims
  • 📊 Notification Management:
    • Get all notifications for a user
    • Mark notifications as seen/acknowledged
    • Get unseen notification count
  • 🗞️ Digests: Daily or weekly digest emails, grouped by category
  • 🧹 Retention: Configurable cleanup of notifications past their retention window
  • 🚀 FastAPI Integration: Full CRUD API endpoints with authentication
  • 📦 PyPI Package: Easy to install and use in any FastAPI project

Installation

Using UV:

uv add fastapi-plugin-notification

Or using pip:

pip install fastapi-plugin-notification

At a Glance

from fastapi_provider_postmark import PostmarkProvider
from fastapi_plugin_notification import NotificationClient

notification_client = NotificationClient(
    postmark_provider=PostmarkProvider(...),
    default_template_id=123456,
)

notification = await notification_client.send_notification(
    db_engine=db,
    name="welcome",
    user_id="user_123",
    user_email="user@example.com",
    claims=request.state.claims,
    link="https://example.com/dashboard",
    link_name="Go to Dashboard",
)

Full setup — client, router and dependencies — is in the Quick Start.

Documentation

Guide Contents
Quick Start Initialize the client, mount the router, send your first notification
Usage Examples Storing, sending, listing and acknowledging notifications
Notification Digests Daily/weekly digests, category grouping, example payload, Postmark Mustachio templates
Cleaning Up Old Notifications Retention window and permanently removing stale notifications
API Endpoints HTTP routes with request parameters and response bodies
Model Structure Fields on NotificationModel
Ownership and Permissions Claim-based ownership and required permissions
Configuration Router options, template variables, error handling
Development Local setup and running the tests

Release history is in the Changelog.

License

MIT License - see LICENSE file for details

Metadata

Release files for fastapi-plugin-notification 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastapi-plugin-notification 0.2.1
File Size Uploaded
fastapi_plugin_notification-0.2.1.tar.gz 17.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fastapi-plugin-notification 0.2.1
File Interpreter ABI Platform
fastapi_plugin_notification-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 30.0 kB

Release files / fastapi_plugin_notification-0.2.1.tar.gz

Download URL fastapi_plugin_notification-0.2.1.tar.gz
Size 17.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d259527ec420827caba9932852e17f6a67ff4650dc4ca73bc3b854c9811b82f1
BLAKE2b-256 checksum
How to use checksums
654074755572ee1d96e6cc142fa356a9d8513ccf3bdbfeb05f6813b7129fbaf7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.

Transparency log

Release files / fastapi_plugin_notification-0.2.1-py3-none-any.whl

Download URL fastapi_plugin_notification-0.2.1-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
702d5c1d7c8869c1695148e94ecdbc317d338934e98439db8737f978a47a3bff
BLAKE2b-256 checksum
How to use checksums
43d83eb684e0580cd33c125b1dd533fc463ab1a3f4f95c7d09fe4d6df84c40fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page