Django email backend for Lettermint
Project description
lettermint-django
An unofficial Django email backend for Lettermint. Drop it in as your EMAIL_BACKEND and all Django mail (send_mail(), EmailMessage, EmailMultiAlternatives) routes through the Lettermint API. Supports per-message routing, HTML emails, attachments, and reply-to headers with no changes to your existing email code.
Built and maintained by zzinnovate. Not affiliated with Lettermint.
Documentation
- Getting Started: Installation • Configuration • Usage
- Reference: Settings • Backend
- Project: Contributing • Changelog • Security
Requirements
- Python 3.11+ (Django 6 requires Python 3.12+)
- Django 4.2, 5.x, or 6.x
- lettermint 2.0+
Install
pip install lettermint-django
# For development (includes testing tools)
pip install -e ".[dev]"
Quick start
import os
EMAIL_BACKEND = "lettermint_django.LettermintEmailBackend"
LETTERMINT_API_KEY = os.getenv("LETTERMINT_API_KEY")
That's it. All send_mail(), EmailMessage, and EmailMultiAlternatives calls in Django will now route through Lettermint.
Settings Reference
| Setting | Required | Default | Description |
|---|---|---|---|
LETTERMINT_API_KEY |
Yes | - | Your project API token from the Lettermint dashboard |
LETTERMINT_BASE_URL |
No | SDK default | Override the Lettermint API base URL |
LETTERMINT_ROUTE |
No | - | Default route applied to all outgoing emails |
LETTERMINT_TIMEOUT |
No | SDK default | Request timeout in seconds |
Per-message Route
Override the route for a specific message via extra_headers:
from django.core.mail import EmailMessage
msg = EmailMessage(
subject="Password reset",
body="Click the link...",
from_email="noreply@example.com",
to=["user@example.com"],
)
msg.extra_headers["X-Lettermint-Route"] = "transactional"
msg.send()
HTML Emails
from django.core.mail import EmailMultiAlternatives
msg = EmailMultiAlternatives(
subject="Welcome",
body="Plain text fallback.",
from_email="noreply@example.com",
to=["user@example.com"],
)
msg.attach_alternative("<h1>Hello!</h1>", "text/html")
msg.send()
Contributing
Contributions are welcome. See CONTRIBUTING.md for development setup, testing, and workflow guidelines.
Security
See SECURITY.md for reporting vulnerabilities and best practices.
Credits
This package is built on top of the official lettermint Python SDK, which handles all API communication.
- Sjoerd Zaalberg van Zelst (zzinnovate)
- All contributors
License
MIT. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lettermint_django-0.2.1a0.tar.gz.
File metadata
- Download URL: lettermint_django-0.2.1a0.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7a5b79be41fbfd054afaab631455ae0645f619cdeb41831ce4a718ff64e529b
|
|
| MD5 |
a1d123af46b43118d6c7324c5c702973
|
|
| BLAKE2b-256 |
b5b9788a0a11706a25f1cf4996b3b699883951464dd9d62d0a20e1c36c912a98
|
Provenance
The following attestation bundles were made for lettermint_django-0.2.1a0.tar.gz:
Publisher:
publish.yml on zzinnovate/lettermint-django
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lettermint_django-0.2.1a0.tar.gz -
Subject digest:
f7a5b79be41fbfd054afaab631455ae0645f619cdeb41831ce4a718ff64e529b - Sigstore transparency entry: 1711409735
- Sigstore integration time:
-
Permalink:
zzinnovate/lettermint-django@5e574ac572f6367ac8440731db1477a5d42cc132 -
Branch / Tag:
refs/tags/v0.2.1-alpha - Owner: https://github.com/zzinnovate
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5e574ac572f6367ac8440731db1477a5d42cc132 -
Trigger Event:
release
-
Statement type:
File details
Details for the file lettermint_django-0.2.1a0-py3-none-any.whl.
File metadata
- Download URL: lettermint_django-0.2.1a0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d629a6c2511ceb3dad53c2e2f49c68b4b696a8dd488c89cf4db4995393eaaee4
|
|
| MD5 |
f1a8f80d28154323c4290ff3cd7349d8
|
|
| BLAKE2b-256 |
610e462057ebccac7ef3c8a90084a339d0dcb4570ed636752adde1121408368f
|
Provenance
The following attestation bundles were made for lettermint_django-0.2.1a0-py3-none-any.whl:
Publisher:
publish.yml on zzinnovate/lettermint-django
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lettermint_django-0.2.1a0-py3-none-any.whl -
Subject digest:
d629a6c2511ceb3dad53c2e2f49c68b4b696a8dd488c89cf4db4995393eaaee4 - Sigstore transparency entry: 1711410225
- Sigstore integration time:
-
Permalink:
zzinnovate/lettermint-django@5e574ac572f6367ac8440731db1477a5d42cc132 -
Branch / Tag:
refs/tags/v0.2.1-alpha - Owner: https://github.com/zzinnovate
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5e574ac572f6367ac8440731db1477a5d42cc132 -
Trigger Event:
release
-
Statement type: