django-forwardemail Documentation

Django integration for ForwardEmail API with multi-site support.

Overview

django-forwardemail is a Django package that provides seamless integration with the ForwardEmail service. It offers:

  • Multi-Site Support: Full Django Sites framework integration

  • Enhanced Site Detection: Automatic fallback mechanisms for missing request/site parameters

  • Backward Compatibility: Maintained EmailService alias for seamless integration

  • Professional Logging: Comprehensive logging instead of debug prints

  • ForwardEmail API: Complete integration with ForwardEmail service

Quick Start

Install the package:

pip install django-forwardemail

Add to your Django settings:

INSTALLED_APPS = [
    # ... other apps
    'django.contrib.sites',  # Required for multi-site support
    'django_forwardemail',
]

Run migrations and create an EmailConfiguration for your site (see Installation and Configuration). Then send email with the service class:

from django_forwardemail.services import ForwardEmailService

ForwardEmailService.send_email(
    to='user@example.com',
    subject='Welcome!',
    text='Welcome to our service!',
    html='<h1>Welcome to our service!</h1>',
)

EmailService is a backward-compatible alias for ForwardEmailService.

Requirements

  • Django 4.2+ (tested through Django 6.0)

  • Python 3.10+

  • requests 2.25.0+

  • ForwardEmail account and API key

Documentation Sections

Indices and tables