Skip to main content

Django + Brevo for transactional emails and customer journey automations.

Project description

Django + Brevo for transactional emails and customer journey automations."

Installation

pip install dj-brevo

Quick Start

1. Add to your INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    "dj_brevo",
]

2. Configure your Brevo API key:

DJ_BREVO = {
    "API_KEY": "your-brevo-api-key",
    "DEFAULT_FROM_EMAIL": "noreply@yourdomain.com",
}

3. Set the email backend:

EMAIL_BACKEND = "dj_brevo.backends.BrevoEmailBackend"

4. Send emails using Django's standard email functions:

from django.core.mail import send_mail

send_mail(
    subject="Welcome!",
    message="Thanks for signing up.",
    from_email="hello@yourdomain.com",
    recipient_list=["user@example.com"],
)

Using Brevo Templates

To send emails using templates created in Brevo's dashboard:

from dj_brevo.services import BrevoClient

client = BrevoClient()
client.send_template_email(
    to=[{"email": "user@example.com", "name": "David"}],
    template_id=12,
    params={"firstName": "David", "orderTotal": "$50"},
)

Configuration

All settings are optional except API_KEY:

DJ_BREVO = {
    # Required
    "API_KEY": "your-brevo-api-key",

    # Optional
    "DEFAULT_FROM_EMAIL": "noreply@yourdomain.com",
    "TIMEOUT": 10,  # Request timeout in seconds
    "API_BASE_URL": "https://api.brevo.com/v3",  # Override for testing
}

Requirements

- Python 3.12+
- Django 5.0+

License

MIT

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

dj_brevo-0.1.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

dj_brevo-0.1.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file dj_brevo-0.1.0.tar.gz.

File metadata

  • Download URL: dj_brevo-0.1.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dj_brevo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 70712cf70559923d1ae41a66fcc0acacb6cbc98e7e2ade44a29063b8639cba56
MD5 bcca4358dd03fcfc8a4c389ede8b95b5
BLAKE2b-256 f2da504191f8868875ea81801f82bbf6d6d7328088fa76f996ee270821f44717

See more details on using hashes here.

Provenance

The following attestation bundles were made for dj_brevo-0.1.0.tar.gz:

Publisher: publish.yml on dmckim1977/dj-brevo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dj_brevo-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dj_brevo-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dj_brevo-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2021b4c29d13f41e7a80c160b076639f1a917cd7d266db6d90e7535884a5c740
MD5 544113e8ea1c0bb22dcce4928fe6f0a3
BLAKE2b-256 9b77d950d285503f8817e4f47207b7c5e97c92ce1b8d749e147fedac9b2f5dfe

See more details on using hashes here.

Provenance

The following attestation bundles were made for dj_brevo-0.1.0-py3-none-any.whl:

Publisher: publish.yml on dmckim1977/dj-brevo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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