Django integration

Transactional email for Django — no Django email backend gymnastics

Post a domain event from any Django view, task or signal handler. else.events routes it to the right template and delivers — no custom email backend required.

Django email infrastructure scales poorly for SaaS product emails

Django email backend ties you to one SMTP config

Switching providers means touching settings.py and testing every email path. Multi-provider setups require third-party backends.

Templates in Django or Jinja2 stay in your repo

Every email copy change means a migration, a review and a deployment.

No central view of sent product emails

send_mail() and EmailMessage() calls scattered across views, tasks and signals have no consolidated audit log.

Localization is manual

Supporting multiple languages per email means per-language templates or complex translation logic in Python.

One requests call — else.events handles routing and delivery

Python requests — no new dependency

If your Django app uses requests (and it almost certainly does), you already have what you need.

Templates outside your repo

Edit subject lines and copy in the else.events dashboard. No migration, no deploy.

Routing by payload fields

Pass plan, locale or tenant in the event data. else.events picks the right template automatically.

Works with Celery and Django signals

Call from a Celery task for async delivery or from a Django signal handler for event-driven triggers.

// Django — Python requests

Send a domain event from Django.

# emails/services.py
import os
import requests

ELSE_EVENTS_API = "https://app.else.events/api/events"

def send_event(event_type: str, user: dict, data: dict) -> None:
    requests.post(
        ELSE_EVENTS_API,
        headers={
            "Authorization": f"Bearer {os.environ['ELSE_EVENTS_API_KEY']}",
            "Content-Type": "application/json",
        },
        json={"type": event_type, "user": user, "data": data},
        timeout=5,
    )

# Usage in a Celery task or view
send_event(
    event_type="invoice.payment_failed",
    user={"email": invoice.user.email, "name": invoice.user.get_full_name()},
    data={"plan": invoice.plan, "amount": str(invoice.amount),
          "currency": "EUR", "update_payment_url": "https://app.example.com/billing"},
)

No new library. If you use requests, you are ready. Wrap it in a Celery task for async delivery and retry support.

Frequently asked questions

Can I use httpx instead of requests?
Yes. httpx is a drop-in alternative with async support. Use httpx.AsyncClient for async Django views.
How do I integrate with Celery?
Create a send_email_event Celery task that calls the else.events API. Queue it with .delay() or .apply_async() from your views or signal handlers.
Can I use this with Django signals?
Yes. Connect a signal receiver to post_save or a custom signal and call send_event() from the receiver. Use Celery for async execution.
How do I test this locally?
Use a test workspace in else.events or mock the requests.post call in your Django tests. No local email server needed.

Django email events — clean, async, no backend gymnastics.

One HTTP call per event type. Templates managed outside your Django repo.

  • Uses requests — no new dependency
  • Works with Celery and Django signals
  • Templates editable without deploys