dmdm-2.0.3
توضیحات
Django MarkDown Mails
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | dmdm-2.0.3 |
| نام | dmdm |
| نسخه کتابخانه | 2.0.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Guilhem Saurel |
| ایمیل نویسنده | guilhem.saurel@laas.fr |
| آدرس صفحه اصلی | https://github.com/nim65s/dmdm |
| آدرس اینترنتی | https://pypi.org/project/dmdm/ |
| مجوز | BSD-2-Clause |
# Django MarkDown Mail
[](https://pypi.org/project/dmdm)
[](https://github.com/nim65s/dmdm/actions/workflows/test.yml)
[](https://results.pre-commit.ci/latest/github/nim65s/dmdm/master)
[](https://codecov.io/gh/nim65s/dmdm)
[](https://codeclimate.com/github/nim65s/dmdm/maintainability)
[](https://github.com/psf/black)
Write your email in markdown, and send them in txt & html.
## Requirements
- Python 3.7+
- 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"},
)
```
نیازمندی
| مقدار | نام |
|---|---|
| >=0.3.0,<0.4.0 | nmdmail |
| >=2.2,<5.0 | Django |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7,<4.0 | Python |
نحوه نصب
نصب پکیج whl dmdm-2.0.3:
pip install dmdm-2.0.3.whl
نصب پکیج tar.gz dmdm-2.0.3:
pip install dmdm-2.0.3.tar.gz