Skip to main content

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

  1. Clone the repository
  2. Install development dependencies: pip install -e ".[dev]"
  3. 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.2.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_mailomat-0.2.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file django_mailomat-0.2.0.tar.gz.

File metadata

  • Download URL: django_mailomat-0.2.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

Hashes for django_mailomat-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c02f56580812904e1ea7e7f259f8e7952412aff56ea65a8b6b0313bb32466b6f
MD5 16eea7e6985b9c1e00ac514c19fa2200
BLAKE2b-256 3640f8bccf9d5e0bd34c66a968d28728f3ed25cd3a9b4aa9e0eccb67ec5885d2

See more details on using hashes here.

File details

Details for the file django_mailomat-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_mailomat-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 71e6605c544b718131a71602ab5477a43fcb5d91e7b84c393ca3e6f5d3f4053c
MD5 ef83ef9e39763842568d2df4aea3f22d
BLAKE2b-256 fb4d309657f72ffdf27d5441d977ce809faefcee383bca968aba6d7f1c0f2b93

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page