{"id":18026542,"url":"https://github.com/omenapps/django-templated-email-md","last_synced_at":"2025-03-27T01:31:14.642Z","repository":{"id":259072315,"uuid":"876250404","full_name":"OmenApps/django-templated-email-md","owner":"OmenApps","description":"An extension for django-templated-email for creating emails with Markdown","archived":false,"fork":false,"pushed_at":"2024-12-23T01:10:29.000Z","size":434,"stargazers_count":33,"open_issues_count":13,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-22T19:01:49.126Z","etag":null,"topics":["django","django-packages","django-templated-email","email","email-template"],"latest_commit_sha":null,"homepage":"https://django-templated-email-md.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OmenApps.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-21T16:44:17.000Z","updated_at":"2025-03-18T15:44:42.000Z","dependencies_parsed_at":"2024-11-14T16:54:36.187Z","dependency_job_id":"f3fe857d-6566-468b-911a-7aa8b188e0c7","html_url":"https://github.com/OmenApps/django-templated-email-md","commit_stats":null,"previous_names":["omenapps/django-templated-email-md"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmenApps%2Fdjango-templated-email-md","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmenApps%2Fdjango-templated-email-md/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmenApps%2Fdjango-templated-email-md/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmenApps%2Fdjango-templated-email-md/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OmenApps","download_url":"https://codeload.github.com/OmenApps/django-templated-email-md/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245764656,"owners_count":20668456,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","django-packages","django-templated-email","email","email-template"],"created_at":"2024-10-30T08:07:17.024Z","updated_at":"2025-03-27T01:31:13.922Z","avatar_url":"https://github.com/OmenApps.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# django-templated-email-md\n\n[![PyPI](https://img.shields.io/pypi/v/django-templated-email-md.svg)][pypi status]\n[![Status](https://img.shields.io/pypi/status/django-templated-email-md.svg)][pypi status]\n[![Python Version](https://img.shields.io/pypi/pyversions/django-templated-email-md)][pypi status]\n[![License](https://img.shields.io/pypi/l/django-templated-email-md)][license]\n\n[![Read the documentation at https://django-templated-email-md.readthedocs.io/](https://img.shields.io/readthedocs/django-templated-email-md/latest.svg?label=Read%20the%20Docs)][read the docs]\n[![Tests](https://github.com/OmenApps/django-templated-email-md/actions/workflows/tests.yml/badge.svg)][tests]\n[![Codecov](https://codecov.io/gh/OmenApps/django-templated-email-md/branch/main/graph/badge.svg)][codecov]\n\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white)][pre-commit]\n[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)][black]\n\n[pypi status]: https://pypi.org/project/django-templated-email-md/\n[read the docs]: https://django-templated-email-md.readthedocs.io/\n[tests]: https://github.com/OmenApps/django-templated-email-md/actions?workflow=Tests\n[codecov]: https://app.codecov.io/gh/OmenApps/django-templated-email-md\n[pre-commit]: https://github.com/pre-commit/pre-commit\n[black]: https://github.com/psf/black\n\n## Features\n\n- **Markdown Templates**: Write email templates using Markdown syntax for cleaner and more readable templates.\n- **Automatic Conversion**: Automatically converts Markdown to HTML and generates a plain text version of emails.\n- **CSS Inlining**: Inlines CSS styles for better email client compatibility using Premailer.\n- **Seamless Integration**: Works as an extension of `django-templated-email`, allowing for easy integration into existing projects.\n- **Template Inheritance**: Supports Django template inheritance and template tags in your Markdown templates.\n\n## Installation\n\nYou can install `django-templated-email-md` via [pip] from [PyPI]:\n\n```bash\npip install django-templated-email-md\n```\n\n### Add to `INSTALLED_APPS`\n\nAdd `templated_email_md` to your `INSTALLED_APPS` in `settings.py`:\n\n```python\nINSTALLED_APPS = [\n    # ...\n    'templated_email_md',\n    # ...\n]\n```\n\n## Configuration\n\nAssuming you have already installed and configured [django-templated-email](https://github.com/vintasoftware/django-templated-email/), update your Django settings as follows:\n\n```python\n# settings.py\n\n# Configure the templated email backend\nTEMPLATED_EMAIL_BACKEND = 'templated_email_md.backend.MarkdownTemplateBackend'\n\n# Optional: Specify the base HTML template for wrapping your content. See the Usage guide for details.\nTEMPLATED_EMAIL_BASE_HTML_TEMPLATE = 'templated_email/markdown_base.html'\n\n# Set the directory where your email templates are stored\nTEMPLATED_EMAIL_TEMPLATE_DIR = 'templated_email/'  # Ensure there's a trailing slash\n\n# Define the file extension for your Markdown templates\nTEMPLATED_EMAIL_FILE_EXTENSION = 'md'\n\n# Optional: Specify Markdown extensions if needed\nTEMPLATED_EMAIL_MARKDOWN_EXTENSIONS = [\n    'markdown.extensions.extra',\n    'markdown.extensions.meta',\n    'markdown.extensions.tables',\n]\n```\n\n## Usage\n\n### Creating Markdown Templates\n\nPlace your Markdown email templates in the `templated_email/` directory within your project's templates directory. For example, create a file `templated_email/welcome.md`:\n\n```markdown\n{% block subject %}Test Email{% endblock %}\n{% block preheader %}Thanks for signing up!{% endblock %}\n\n{% block content %}\n# {{ user.first_name }}, you're in!\n\n![Gorgeous, golden potato, Spedona, CC BY-SA 3.0 https://creativecommons.org/licenses/by-sa/3.0, via Wikimedia Commons](https://upload.wikimedia.org/wikipedia/commons/a/a4/Icone_pdt.png)\n\n## Welcome to The Potato Shop\n\n### Hello {{ user.fiest_name }}! 👋\n\n\u003e You have been invited to set up an account at the Potato shop on behalf of  **{{ inviter.name }}**.\n\nPlease click [this link]({% url 'invitations:accept-invite' key=invitation.key %}) to establish your account.\n\n{% blocktranslate %}You will be directed to the 'set password' tool, where you can establish your account password.{% endblocktranslate %}\n\n---\n\nBest regards,\n\n*Jack Linke*\nPotato Shop, LLC - Managing Director\n\n*Semi-round, Starchy Veggies for All*\n{% endblock %}\n```\n\n### Sending Emails\n\nUse the `send_templated_mail` function to send emails using your Markdown templates, just as you would with the base django-templated-email package:\n\n```python\nfrom templated_email import send_templated_mail\n\nsend_templated_mail(\n    template_name='welcome',\n    from_email='Potato Shop Support \u003csupport@mashedupyum.com\u003e',\n    recipient_list=['terrence3725fries@wannamashitup.com'],\n    context={\n        'user': request.user,\n        'inviter': inviter,\n    },\n)\n```\n\n### The Result\n\n#### Inbox Preview\n\n![Inbox Preview](https://raw.githubusercontent.com/OmenApps/django-templated-email-md/refs/heads/main/docs/_static/inbox_screenshot.png)\n\n#### Email Preview\n\n![Email Preview](https://raw.githubusercontent.com/OmenApps/django-templated-email-md/0495a02b8f4a6affebefb3c2e89562c553851b17/docs/_static/email_screenshot.png)\n\nMore detailed information can be found in the [usage guide][usage guide].\n\n## Documentation\n\nFor more detailed information, please refer to the [full documentation][read the docs].\n\n## Contributing\n\nContributions are very welcome. To learn more, see the [Contributor Guide].\n\n## License\n\nDistributed under the terms of the [MIT license][license], `django-templated-email-md` is free and open source software.\n\n## Issues\n\nIf you encounter any problems, please [file an issue] along with a detailed description.\n\n## Credits\n\nWe are grateful to the maintainers of the following projects:\n\n- [django-templated-email](https://github.com/vintasoftware/django-templated-email/)\n- [emark](https://github.com/voiio/emark)\n\nThis project was generated from [@OmenApps]'s [Cookiecutter Django Package] template.\n\n[@omenapps]: https://github.com/OmenApps\n[pypi]: https://pypi.org/\n[license]: https://github.com/OmenApps/django-templated-email-md/blob/main/LICENSE\n[read the docs]: https://django-templated-email-md.readthedocs.io/\n[usage guide]: https://django-templated-email-md.readthedocs.io/en/latest/usage.html\n[contributor guide]: https://github.com/OmenApps/django-templated-email-md/blob/main/CONTRIBUTING.md\n[file an issue]: https://github.com/OmenApps/django-templated-email-md/issues\n[cookiecutter django package]: https://github.com/OmenApps/cookiecutter-django-package\n[pip]: https://pip.pypa.io/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomenapps%2Fdjango-templated-email-md","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomenapps%2Fdjango-templated-email-md","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomenapps%2Fdjango-templated-email-md/lists"}