{ "info": { "author": "Rhys Gibbs", "author_email": "development@rhysgibbs.co.uk", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 2.2", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "# Django HTML Email Templates\n\nA Django app for allowing users to create html emails using Django template variables\npassed in to the context.\n\n\n## Installation\n\nUse the package manager [pip](https://pip.pypa.io/en/stable/) to install django-html-emailtemplates.\n\n pip install django-html-emailtemplates\n\nAdd the package to your INSTALLED_APPS\n\n INSTALLED_APPS = [\n ...\n 'emailtemplates',\n ...\n ]\n\n\n## Usage\n\n # models.py\n from emailtemplates.fields import EmailTemplateField\n class Settings(models.Model):\n contact_form_reply = EmailTemplateField(\n models.SET_NULL,\n null=True,\n email_context=\"\"\"\n You can use the following variables in the template:\n {{ name }}\n {{ subject_matter }}\n {% for item in items %}\n Possible values are:\n {{ item.title }}\n {{ item.cost }}\n {{ item.description }}\n {% endfor %}\n \"\"\"\n )\n\n # views.py\n from emailtemplates.utils import send_email_template\n from emailtemplates.models import EmailTemplate\n from .models import Settings\n\n # view definition\n def form_valid(self, form):\n enquiry = form.save()\n # send reply email to website user\n send_email_template(\n Settings.objects.first().contact_form_reply,\n [enquiry.email],\n {\n 'name': enquiry.name,\n 'subject_matter': enquiry.subject,\n 'items': [\n {\n 'title': 'Product',\n 'cost': '£20.00',\n 'description': 'Product description...'\n }\n ]\n }\n )\n # send notification to website owner\n send_email_template(\n EmailTemplate(\n subject='Enquiry from example.com',\n content='''
\n

There was an enquiry on your website, the details are below:

\n \n \n \n \n \n \n \n
Name:{{ enquiry.name }}
\n
'''\n ),\n ['contact@example.com'],\n {\n 'enquiry': enquiry\n }\n )\n\n\n![alt text](https://github.com/RG1BB5/django-html-emailtemplates/blob/master/example-emailtemplate-field.png \"Example EmailTemplateField\")\n\n\n## Features to add\n- [ ] Add custom ForeignKey field to display the context that can be used\n- [ ] Add base email header/footer\n- [ ] Add plugins for images/documents\n- [ ] Add better html field\n- [ ] Add support for Wagtail StreamField", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/RG1BB5/django-html-emailtemplates", "keywords": "", "license": "BSD License", "maintainer": "", "maintainer_email": "", "name": "django-html-emailtemplates", "package_url": "https://pypi.org/project/django-html-emailtemplates/", "platform": "", "project_url": "https://pypi.org/project/django-html-emailtemplates/", "project_urls": { "Homepage": "https://github.com/RG1BB5/django-html-emailtemplates" }, "release_url": "https://pypi.org/project/django-html-emailtemplates/0.0.2/", "requires_dist": null, "requires_python": "", "summary": "A simple Django app to create and send editable emails.", "version": "0.0.2" }, "last_serial": 5898564, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "e4578995a9d3c78a78b7c464ffe22a8f", "sha256": "d888a27fde767e6d379a8ad06d5e130f334e7803ce453261d800ce3e74664736" }, "downloads": -1, "filename": "django-html-emailtemplates-0.0.1.tar.gz", "has_sig": false, "md5_digest": "e4578995a9d3c78a78b7c464ffe22a8f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7579, "upload_time": "2019-09-26T22:47:29", "url": "https://files.pythonhosted.org/packages/0f/81/1f9b6d36baf2efd0b830e8b5c184c100d240075490490834405afdf6b02a/django-html-emailtemplates-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "aac02cb72e883fe301af96a1fc2b9c13", "sha256": "2518590da432a657c10061de66e8ba8cbf154d0bdf08fe2320a0b8582b3fb419" }, "downloads": -1, "filename": "django-html-emailtemplates-0.0.2.tar.gz", "has_sig": false, "md5_digest": "aac02cb72e883fe301af96a1fc2b9c13", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8711, "upload_time": "2019-09-28T00:29:28", "url": "https://files.pythonhosted.org/packages/82/af/cdd755e742e2e6a17ea0571529c52faa87253f2f5085b7a902e0bf66d69d/django-html-emailtemplates-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "aac02cb72e883fe301af96a1fc2b9c13", "sha256": "2518590da432a657c10061de66e8ba8cbf154d0bdf08fe2320a0b8582b3fb419" }, "downloads": -1, "filename": "django-html-emailtemplates-0.0.2.tar.gz", "has_sig": false, "md5_digest": "aac02cb72e883fe301af96a1fc2b9c13", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8711, "upload_time": "2019-09-28T00:29:28", "url": "https://files.pythonhosted.org/packages/82/af/cdd755e742e2e6a17ea0571529c52faa87253f2f5085b7a902e0bf66d69d/django-html-emailtemplates-0.0.2.tar.gz" } ] }