{"id":21167,"library":"django-templated-email","title":"django-templated-email","description":"A Django-oriented templated/transactional email abstraction library that supports multiple backends (e.g., Mandrill, SendGrid, SES) and allows you to send emails using Django templates. Current version 3.1.1 supports Django 4.2, 5.0, 5.1 and Python 3.10-3.13. Release cadence is sporadic.","status":"active","version":"3.1.1","language":"python","source_language":"en","source_url":"https://github.com/vintasoftware/django-templated-email","tags":["django","email","templated-email"],"install":[{"cmd":"pip install django-templated-email","lang":"bash","label":"Standard installation"}],"dependencies":[],"imports":[{"note":"Wrong package name; correct module is 'templated_email'.","wrong":"from django_templated_email import send_templated_email","symbol":"send_templated_email","correct":"from templated_email import send_templated_email"},{"note":"","wrong":"","symbol":"get_templated_mail","correct":"from templated_email import get_templated_mail"}],"quickstart":{"code":"import os\nfrom templated_email import send_templated_email\n\nsend_templated_email(\n    template_name='welcome',\n    from_email='from@example.com',\n    recipient_list=['to@example.com'],\n    context={'username': 'John', 'site_url': 'http://example.com'},\n    # For authentication, set EMAIL_HOST_USER and EMAIL_HOST_PASSWORD in Django settings.\n)\n","lang":"python","description":"Sends an email using a Django template named 'welcome'. Requires Django settings for email backend (e.g., SMTP)."},"warnings":[{"fix":"Wrap your HTML content in {% autoescape off %}...{% endautoescape %} if you need raw HTML.","message":"In version 3.0.0, HTML parts in templates are now escaped by default. If you relied on unescaped HTML, you need to use the 'autoescape' block.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Upgrade to Python >=3.10 and Django >=4.2.","message":"Python 3.6, 3.7, 3.8 and Django 2.2, 3.1, 3.2 are no longer supported as of version 3.1.0.","severity":"deprecated","affected_versions":"<3.1.0"},{"fix":"Ensure your email templates are located at: <app>/templates/templated_email/<template_name>.email (or .txt for plain text).","message":"The library expects template files to be in a 'templated_email/' directory under your templates. If templates are missing, it silently falls back to plain text without error.","severity":"gotcha","affected_versions":"all"},{"fix":"Set DEFAULT_FROM_EMAIL in settings or always pass from_email.","message":"Calling send_templated_email without an explicit 'from_email' parameter will raise an error if settings.DEFAULT_FROM_EMAIL is not set.","severity":"gotcha","affected_versions":"<3.1.1, also affects >=3.1.1 if DEFAULT_FROM_EMAIL not set"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use `from templated_email import send_templated_email` instead.","cause":"The import path uses the wrong module name (common mistake).","error":"ModuleNotFoundError: No module named 'django_templated_email'"},{"fix":"Add `TEMPLATED_EMAIL_BACKEND = 'templated_email.backends.vanilla_mail.TemplateBackend'` to your Django settings (or another backend).","cause":"TEMPLATED_EMAIL_BACKEND setting is missing or not configured correctly.","error":"KeyError: 'TEMPLATED_EMAIL_BACKEND'"},{"fix":"Set up Django settings with os.environ['DJANGO_SETTINGS_MODULE'] and call django.setup() before sending emails.","cause":"Django settings are not configured before using the library (e.g., in standalone script).","error":"django.core.exceptions.ImproperlyConfigured: Requested setting EMAIL_BACKEND, but settings are not configured."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}