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
-----------
0. Add it to your Environment using::
pip install django-proemail-template django-summernote
1. Add "django-email-template" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = [
...
'django_summernote'#required
'EmailTemplate',
]
2. Run `python manage.py migrate` to create the polls models.
3. 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,
})
Raw data
{
"_id": null,
"home_page": "https://github.com/iwalucas/django-email-template/",
"name": "django-proemail-template",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Lucas",
"author_email": "teppss@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/3b/e3/a6d544dee95b789397f54ac79811ce0acad52f4909159842bd84d884838a/django-proemail-template-0.2.6.tar.gz",
"platform": null,
"description": "A few months ago, I ran into this post https://blog.anvileight.com/posts/django-email-templates-with-context-stored-in-database/\nand decided to make it into a lib after using it on one of my projects\n\nQuick start\n-----------\n\n0. Add it to your Environment using::\n\n pip install django-proemail-template django-summernote\n\n\n1. Add \"django-email-template\" to your INSTALLED_APPS setting like this::\n\n INSTALLED_APPS = [\n ...\n 'django_summernote'#required\n 'EmailTemplate',\n ]\n\n2. Run `python manage.py migrate` to create the polls models.\n\n3. add url for summernote::\n\n path('summernote/', include('django_summernote.urls')),\n\nYou should see it under admin\n\nHow to use it\n-------------\nCreate a new template on admin called default, setting the required info. Use \"object\" as the context to access the variables (like on a view).\n\n\nAnd send it from any code::\n\n EmailTemplate.send('default', {\n 'object': your_model_instance,\n })\n \n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "A simple Django app to send emails",
"version": "0.2.6",
"project_urls": {
"Homepage": "https://github.com/iwalucas/django-email-template/"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3dd0918450cacb16d3a448bef20a90f8d343f04146f3c869b752740fee7c2d70",
"md5": "5cdafdc91a8d5fc0ea1db98ee85c4f7a",
"sha256": "89de4ef1088f2c6646c707935d4486283106dd2d80a605d2e99bd2d04de84477"
},
"downloads": -1,
"filename": "django_proemail_template-0.2.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5cdafdc91a8d5fc0ea1db98ee85c4f7a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 8352,
"upload_time": "2024-03-13T16:39:33",
"upload_time_iso_8601": "2024-03-13T16:39:33.006346Z",
"url": "https://files.pythonhosted.org/packages/3d/d0/918450cacb16d3a448bef20a90f8d343f04146f3c869b752740fee7c2d70/django_proemail_template-0.2.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3be3a6d544dee95b789397f54ac79811ce0acad52f4909159842bd84d884838a",
"md5": "ca02de52c99b61228f8d01ad5de2e035",
"sha256": "efce4d4ae8d895b659f5d4ee3d42630948b17638e268629e3498cec1dab985fb"
},
"downloads": -1,
"filename": "django-proemail-template-0.2.6.tar.gz",
"has_sig": false,
"md5_digest": "ca02de52c99b61228f8d01ad5de2e035",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5540,
"upload_time": "2024-03-13T16:39:34",
"upload_time_iso_8601": "2024-03-13T16:39:34.631464Z",
"url": "https://files.pythonhosted.org/packages/3b/e3/a6d544dee95b789397f54ac79811ce0acad52f4909159842bd84d884838a/django-proemail-template-0.2.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-13 16:39:34",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "iwalucas",
"github_project": "django-email-template",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "django-proemail-template"
}