Install & Compatibility
Where this runs
tested against v3.1.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 66.5MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.5s · import 0.000s · 67MB
66MB installed
● package 66MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
send_templated_mail
✓ from templated_email import send_templated_mail
✗ from templated_email import send_templated_email
get_templated_mail
✓ from templated_email import get_templated_mail
TemplateBackend
✓ from templated_email import TemplateBackend
Sends an email using a Django template named 'welcome'. Requires Django settings for email backend (e.g., SMTP).
import os
from templated_email import send_templated_email
send_templated_email(
template_name='welcome',
from_email='from@example.com',
recipient_list=['to@example.com'],
context={'username': 'John', 'site_url': 'http://example.com'},
# For authentication, set EMAIL_HOST_USER and EMAIL_HOST_PASSWORD in Django settings.
)
Debug
Known issues
breakingIn 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.fixWrap your HTML content in {% autoescape off %}...{% endautoescape %} if you need raw HTML. affects: >=3.0.0
deprecatedPython 3.6, 3.7, 3.8 and Django 2.2, 3.1, 3.2 are no longer supported as of version 3.1.0.fixUpgrade to Python >=3.10 and Django >=4.2.
affects: <3.1.0
gotchaThe 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.fixEnsure your email templates are located at: <app>/templates/templated_email/<template_name>.email (or .txt for plain text).
affects: all
gotchaCalling send_templated_email without an explicit 'from_email' parameter will raise an error if settings.DEFAULT_FROM_EMAIL is not set.fixSet DEFAULT_FROM_EMAIL in settings or always pass from_email.
affects: <3.1.1, also affects >=3.1.1 if DEFAULT_FROM_EMAIL not set
Upgrade
Version history
3.1.1latest on PyPI · released Aug 21, 2025
Audit
Dependencies
No dependency data recorded yet.