Django MarkDown Mails
Project description
Django MarkDown Mail
Write your email in markdown, and send them in txt & html.
Requirements
- Python 3.10+
- Django 2.0+
- 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.
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:
send_mail(
subject,
"test_email_template.md",
from_email,
recipient_list,
{"template_variable": "value"},
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dmdm-3.1.0.tar.gz.
File metadata
- Download URL: dmdm-3.1.0.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
360e37547456d58e33340562ff0d4285427e6c0a598fde818fbe42e8ea838df7
|
|
| MD5 |
68bc58e997c8ec5677b96e4dc3d5cfd2
|
|
| BLAKE2b-256 |
b2deca7bc92c3911a832b2a8f4e42dc39558290bd019400953cd1cae68cfd5b4
|
Provenance
The following attestation bundles were made for dmdm-3.1.0.tar.gz:
Publisher:
release.yml on nim65s/dmdm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dmdm-3.1.0.tar.gz -
Subject digest:
360e37547456d58e33340562ff0d4285427e6c0a598fde818fbe42e8ea838df7 - Sigstore transparency entry: 656733108
- Sigstore integration time:
-
Permalink:
nim65s/dmdm@629aca32c330088ba024da0d73bfe955d53a4fee -
Branch / Tag:
refs/tags/v3.1.0 - Owner: https://github.com/nim65s
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@629aca32c330088ba024da0d73bfe955d53a4fee -
Trigger Event:
push
-
Statement type:
File details
Details for the file dmdm-3.1.0-py3-none-any.whl.
File metadata
- Download URL: dmdm-3.1.0-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38b95055df0c0195f4a02dffc1db73ba7984a56310b66210a5d0cd271088e90f
|
|
| MD5 |
208a4d96188aa207a60da9761489d5b7
|
|
| BLAKE2b-256 |
a84c8f1cd3d58c8a22deb006a33cc4f6566c076bf6118313eb07224d2f2bf8b1
|
Provenance
The following attestation bundles were made for dmdm-3.1.0-py3-none-any.whl:
Publisher:
release.yml on nim65s/dmdm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dmdm-3.1.0-py3-none-any.whl -
Subject digest:
38b95055df0c0195f4a02dffc1db73ba7984a56310b66210a5d0cd271088e90f - Sigstore transparency entry: 656733140
- Sigstore integration time:
-
Permalink:
nim65s/dmdm@629aca32c330088ba024da0d73bfe955d53a4fee -
Branch / Tag:
refs/tags/v3.1.0 - Owner: https://github.com/nim65s
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@629aca32c330088ba024da0d73bfe955d53a4fee -
Trigger Event:
push
-
Statement type: