Skip to main content

Django MarkDown Mail

PyPI version Tests pre-commit.ci status codecov Maintainability Code style: black

Write your email in markdown, and send them in txt & html.

Requirements

Install

python -m pip install dmdm

Usage

This replaces django's django.core.email.send_mail, but the mail will have an html alternative rendered from the text part with markdown. You can also provide a custom css and even images (that will be inlined) located in image_root.

from dmdm import send_mail

def send_mail(
    subject: str,
    message: str,
    from_email: str,
    recipient_list: List[str],
    context: Optional[Dict] = None,
    request: Optional[HttpRequest] = None,
    fail_silently: bool = False,
    css: Optional[str] = None,
    image_root: str = ".",
    auth_user: Optional[str] = None,
    auth_password: Optional[str] = None,
    connection: Optional[BaseEmailBackend] = None,
    reply_to: Optional[List[str]] = None,
    headers: Optional[Dict[str, str]] = None,
) -> int

If you want to write your markdown in a template, just put the name of the template in message and add a context (which can be {}) and eventually a request:

send_mail(
    subject,
    "test_email_template.md",
    from_email,
    recipient_list,
    {"template_variable": "value"},
)

Metadata

Release files for dmdm 4.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 dmdm 4.0.0
File Size Uploaded
dmdm-4.0.0.tar.gz 2.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dmdm 4.0.0
File Interpreter ABI Platform
dmdm-4.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.5 kB

Release files / dmdm-4.0.0.tar.gz

Download URL dmdm-4.0.0.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
70ee9761b70ce46e3b2d019cf91b96c6503bd6ddbf7f951638b7a03775199017
BLAKE2b-256 checksum
How to use checksums
f8ccde0acce342eb824bbc178f3d6474754ae79d721e4b38ab84b0086233036d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 26, 2026.

Transparency log

Release files / dmdm-4.0.0-py3-none-any.whl

Download URL dmdm-4.0.0-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7fafe666e015df1a61fcded47d24c5fe9ffcb866c7001f71a2b351d6e3c6f117
BLAKE2b-256 checksum
How to use checksums
ef1b6a4202fcd51d418b18358d9c082f200cd961a2878177443087469f7af8b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 26, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

4.0.0 This release

2 release files

3.2.0

2 release files

3.1.0

2 release files

3.0.0

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.4.5

2 release files

1.4.4

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.0.2

2 release files

1.0.1

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