Django email backend for Mailomat API
Project description
Django Mailomat
A Django email backend for sending emails through the Mailomat API.
Installation
pip install django-mailomat
Configuration
Add the following settings to your Django settings file:
# Mailomat settings
MAILOMAT_API_URL = 'http://mailomat-api:5000' # Your Mailomat API URL
MAILOMAT_API_TOKEN = 'your-api-token' # Your Mailomat API token
DEFAULT_FROM_EMAIL = 'noreply@example.com' # Default sender email
# Use the Mailomat email backend
EMAIL_BACKEND = 'django_mailomat.backend.MailomatEmailBackend'
Usage
The backend can be used like any other Django email backend:
from django.core.mail import send_mail
send_mail(
'Subject',
'Message',
'from@example.com',
['to@example.com'],
fail_silently=False,
)
Features
- Supports both plain text and HTML email content
- Handles email attachments
- Includes API token authentication
- Sanitizes email addresses
- Configurable fail_silently option
Development
- Clone the repository
- Install development dependencies:
pip install -e ".[dev]" - Run tests:
pytest
License
MIT License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django_mailomat-0.4.0.tar.gz
(3.8 kB
view details)
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 django_mailomat-0.4.0.tar.gz.
File metadata
- Download URL: django_mailomat-0.4.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59eb74571e4666e15fc18f7e9440cd27fe1a952964a50a1579412b22069d8df6
|
|
| MD5 |
a4566494c513fec3b6de05905dff2b17
|
|
| BLAKE2b-256 |
975fca1600c3fdca281830e635e21fe3120b7f39f7141f586392deef2f8ef4b8
|
File details
Details for the file django_mailomat-0.4.0-py3-none-any.whl.
File metadata
- Download URL: django_mailomat-0.4.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e3aa11c4911fa8296ac1a64a16235c0de43c8949ea7f00f3b6e12328bda46f6
|
|
| MD5 |
e3c1ec41fbd461a458f6d849a7d50459
|
|
| BLAKE2b-256 |
246c7c0d43285ce7bfc8e23a74fedc8d3789a4c9bbc7f7c6c6d9c4e413c69d59
|