dmdm


Namedmdm JSON
Version 3.0.0 PyPI version JSON
download
home_pageNone
SummaryDjango MarkDown Mails
upload_time2025-08-19 13:36:31
maintainerNone
docs_urlNone
authorGuilhem Saurel
requires_python>=3.10
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            #  Django MarkDown Mail

[![PyPI version](https://badge.fury.io/py/dmdm.svg)](https://pypi.org/project/dmdm)
[![Tests](https://github.com/nim65s/dmdm/actions/workflows/test.yml/badge.svg)](https://github.com/nim65s/dmdm/actions/workflows/test.yml)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/nim65s/dmdm/main.svg)](https://results.pre-commit.ci/latest/github/nim65s/dmdm/main)
[![codecov](https://codecov.io/gh/nim65s/dmdm/branch/main/graph/badge.svg?token=CUHNXAVJPO)](https://codecov.io/gh/nim65s/dmdm)
[![Maintainability](https://api.codeclimate.com/v1/badges/6737a84239590ddc0d1e/maintainability)](https://codeclimate.com/github/nim65s/dmdm/maintainability)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

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

## Requirements

- Python 3.10+
- Django 2.0+
- [nmdmail](https://github.com/nim65s/nmdmail)

## 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`.


```python
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,
) -> 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`:

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

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "dmdm",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "Guilhem Saurel",
    "author_email": "Guilhem Saurel <guilhem.saurel@laas.fr>",
    "download_url": "https://files.pythonhosted.org/packages/72/38/639b659a3491101e9df055fe8bef4271db95f5598be8b2686b22eefc0b7a/dmdm-3.0.0.tar.gz",
    "platform": null,
    "description": "#  Django MarkDown Mail\n\n[![PyPI version](https://badge.fury.io/py/dmdm.svg)](https://pypi.org/project/dmdm)\n[![Tests](https://github.com/nim65s/dmdm/actions/workflows/test.yml/badge.svg)](https://github.com/nim65s/dmdm/actions/workflows/test.yml)\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/nim65s/dmdm/main.svg)](https://results.pre-commit.ci/latest/github/nim65s/dmdm/main)\n[![codecov](https://codecov.io/gh/nim65s/dmdm/branch/main/graph/badge.svg?token=CUHNXAVJPO)](https://codecov.io/gh/nim65s/dmdm)\n[![Maintainability](https://api.codeclimate.com/v1/badges/6737a84239590ddc0d1e/maintainability)](https://codeclimate.com/github/nim65s/dmdm/maintainability)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nWrite your email in markdown, and send them in txt & html.\n\n## Requirements\n\n- Python 3.10+\n- Django 2.0+\n- [nmdmail](https://github.com/nim65s/nmdmail)\n\n## Install\n\n`python -m pip install dmdm`\n\n## Usage\n\nThis replaces django's `django.core.email.send_mail`, but the mail will have an html alternative rendered from the text\npart with markdown. You can also provide a custom `css` and even images (that will be inlined) located in `image_root`.\n\n\n```python\nfrom dmdm import send_mail\n\ndef send_mail(\n    subject: str,\n    message: str,\n    from_email: str,\n    recipient_list: List[str],\n    context: Optional[Dict] = None,\n    request: Optional[HttpRequest] = None,\n    fail_silently: bool = False,\n    css: Optional[str] = None,\n    image_root: str = \".\",\n    auth_user: Optional[str] = None,\n    auth_password: Optional[str] = None,\n    connection: Optional[BaseEmailBackend] = None,\n    reply_to: Optional[List[str]] = None,\n) -> int\n```\n\nIf you want to write your markdown in a template, just put the name of the template in `message` and add a `context`\n(which can be `{}`) and eventually a `request`:\n\n```python\nsend_mail(\n    subject,\n    \"test_email_template.md\",\n    from_email,\n    recipient_list,\n    {\"template_variable\": \"value\"},\n)\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Django MarkDown Mails",
    "version": "3.0.0",
    "project_urls": {
        "changelog": "https://github.com/nim65s/dmdm/blob/main/CHANGELOG.md",
        "homepage": "https://github.com/nim65s/dmdm",
        "repository": "https://github.com/nim65s/dmdm.git"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "11732dd4536a2fce73bc8b05a7e8a25ae2a6c54fa1b475125bd19555971be1fd",
                "md5": "96c66c065b664fabd3fe5b214c39a9a3",
                "sha256": "7641d29b2bc6ca2d119f770d66382df053e9b8cc32fa0f633a90966a17302f54"
            },
            "downloads": -1,
            "filename": "dmdm-3.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "96c66c065b664fabd3fe5b214c39a9a3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 3121,
            "upload_time": "2025-08-19T13:36:30",
            "upload_time_iso_8601": "2025-08-19T13:36:30.442393Z",
            "url": "https://files.pythonhosted.org/packages/11/73/2dd4536a2fce73bc8b05a7e8a25ae2a6c54fa1b475125bd19555971be1fd/dmdm-3.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7238639b659a3491101e9df055fe8bef4271db95f5598be8b2686b22eefc0b7a",
                "md5": "0de8a6a1ed3855ba9f99695e80fb84a9",
                "sha256": "5ba784c341a9b1a803c4dcd12d777e6b5b7d9ec495f728bd8d276ae0779296c2"
            },
            "downloads": -1,
            "filename": "dmdm-3.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0de8a6a1ed3855ba9f99695e80fb84a9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 2272,
            "upload_time": "2025-08-19T13:36:31",
            "upload_time_iso_8601": "2025-08-19T13:36:31.705754Z",
            "url": "https://files.pythonhosted.org/packages/72/38/639b659a3491101e9df055fe8bef4271db95f5598be8b2686b22eefc0b7a/dmdm-3.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-19 13:36:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nim65s",
    "github_project": "dmdm",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "dmdm"
}
        
Elapsed time: 1.62681s