A few months ago, I ran into this post https://blog.anvileight.com/posts/django-email-templates-with-context-stored-in-database/ and decided to make it into a lib after using it on one of my projects
Quick start
Add it to your Environment using:
pip install django-proemail-template django-summernote
Add “django-email-template” to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [ ... 'django_summernote'#required 'EmailTemplate', ]Run python manage.py migrate to create the polls models.
add url for summernote:
path('summernote/', include('django_summernote.urls')),
You should see it under admin
How to use it
Create a new template on admin called default, setting the required info. Use “object” as the context to access the variables (like on a view).
And send it from any code:
EmailTemplate.send('default', {
'object': your_model_instance,
})
Metadata
Release files for django-proemail-template 0.2.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_proemail_template-0.2.7-py3-none-any.whl | Python 3 | none | any | Details |
Release files / django_proemail_template-0.2.7-py3-none-any.whl
| Download URL | django_proemail_template-0.2.7-py3-none-any.whl |
|---|---|
| Size | 9.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
32297145a3f4ffcea541f9920860086311e40e756fce9dc9bc5393576e4f84b1
|
|
BLAKE2b-256 checksum How to use checksums |
39343512cb1580565061a5fd6e23beaf042eb5012b053fee70d85b817c3c91b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.6
|