Skip to main content

codecov PyPI - Version

Django Better Azure Communication Email

This is a fork from: https://github.com/retech-us/django-azure-communication-email

A Django email backend for Azure Communication Email service.

Installation

Run the following on your system:

pip install django-better-azure-communication-email

Then, add these settings to your Django settings.py:

EMAIL_BACKEND = 'django_better_azure_communication_email.EmailBackend'

AZURE_COMMUNICATION_CONNECTION_STRING = '...'
# OR
AZURE_KEY_CREDENTIAL = '...'
AZURE_COMMUNICATION_ENDPOINT = '...'

If you prefer to use Azure Active Directory authentication, you can use the following settings.py instead:

EMAIL_BACKEND = 'django_better_azure_communication_email.EmailBackend'

AZURE_COMMUNICATION_ENDPOINT = '...'

# Note: make sure to set the following environment variables:
# AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET

Now, when you use django.core.mail.send_mail, Azure Communication Email service will send the messages by default.

Using MAILERS (Django 6.1+)

Django 6.1 introduced the MAILERS setting, which deprecates EMAIL_BACKEND. Both are supported. With MAILERS, the backend can be configured through OPTIONS:

MAILERS = {
    "default": {
        "BACKEND": "django_better_azure_communication_email.EmailBackend",
        "OPTIONS": {
            "connection_string": "...",
        },
    },
}

Available OPTIONS (each one falls back to the matching setting when not given):

Option Fallback setting
connection_string AZURE_COMMUNICATION_CONNECTION_STRING
endpoint AZURE_COMMUNICATION_ENDPOINT
key_credential AZURE_KEY_CREDENTIAL
tenant_id AZURE_TENANT_ID
client_id AZURE_CLIENT_ID
client_secret AZURE_CLIENT_SECRET
tracking_disabled AZURE_COMMUNICATION_TRACKING_DISABLED
fail_silently (defaults to False)

Note: Django does not allow the fail_silently argument together with using (e.g. send_mail(..., using="default", fail_silently=True) raises a TypeError). If you need a mailer that fails silently, set "fail_silently": True in its OPTIONS instead.

Metadata

Release files for django-better-azure-communication-email 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-better-azure-communication-email 1.0.0
File Size Uploaded
django_better_azure_communication_email-1.0.0.tar.gz 9.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-better-azure-communication-email 1.0.0
File Interpreter ABI Platform
django_better_azure_communication_email-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.0 kB

Release files / django_better_azure_communication_email-1.0.0.tar.gz

Download URL django_better_azure_communication_email-1.0.0.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
28fb4c8bd5e05497e7f5cf79b548e055797895802b0767478d2b9c179329921a
BLAKE2b-256 checksum
How to use checksums
7ed3077682bfa1339823304d5751e18624594b442de8b0bc7d7690caca8146c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.12.3 Linux/6.17.0-1022-azure

Release files / django_better_azure_communication_email-1.0.0-py3-none-any.whl

Download URL django_better_azure_communication_email-1.0.0-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
37996764a8a905d15289d62b8dad4155060dd0eb53bfaeb2dfb2a4716d70dfd4
BLAKE2b-256 checksum
How to use checksums
463300b96e6a0810cd23d0646584b158212d33a107a18e05a01af3d59fad763e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.12.3 Linux/6.17.0-1022-azure

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.0.1

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page