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.6.0.tar.gz (3.9 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.6.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_mailomat-0.6.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for django_mailomat-0.6.0.tar.gz
Algorithm Hash digest
SHA256 f9f36f12c2f3cc2227347b7af363f9703fcab6c85a018fe89ecadf28741f8566
MD5 e83a0b92fbb39de270ebed7487c2c648
BLAKE2b-256 29a33c7bf1b5274291ca8a0b514973a0b117323fda5e9495cf4ec0e5ea3ac350

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_mailomat-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49ca780aea6e66c03ac2c742135bcf7e1996f92bfbd9d1a942f885f2ef806884
MD5 69957c7a043cddc5969904961acdc02c
BLAKE2b-256 c9bfb300e0b1c523469a33dbb516ed06149e66ca97aa1bd146f21c17847c0f6f

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