{ "info": { "author": "Joshua Tauberer", "author_email": "jt@occams.info", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Django HTML Emailer\n===================\n\nA utility app for sending HTML emails in Django 1.7+:\n\n* Uses [HTML Email Boilerplate v0.5](http://htmlemailboilerplate.com/)\n* Inlines CSS (per the boilerplate's instructions) using [pynliner](https://pythonhosted.org/pynliner/).\n* Renders message body from Markdown or from text and HTML parts that you give.\n\nInstallation\n------------\n\nInstall this module:\n\n\tpip install django-html-emailer\n\nAdd `htmlemailer` to your Django settings's INSTALLED_APPS.\n\nBasic Usage\n-----------\n\nHere's a quick example for how to send a message:\n\n\tfrom htmlemailer import send_mail\n\n\tsend_mail(\n\t\t\"htmlemailer/example\",\n\t\t\"My Site \",\n\t\t[\"you@recipient.com\"],\n\t\t{\n\t\t\t\"my_message\": \"Hello & good day to you!\"\n\t\t})\n\nReplace the recipient address with your email address. This should send you a message using the example template.\n\nYour Templates\n--------------\n\nhtmlemailer composes your actual email from a series of templates. Usually you have:\n\n1. A template storing the actual content of your email (either a Markdown template or a pair of templates, one for the HTML part and one for the plain text part), which extends...\n2. A template that has the general design of all of your emails (CSS, header, footer), akin to your `base.html` for your site (a pair of templates, one for HTML and one for text), which extends...\n3. The HTML Email Boilerplate, which we've already converted into a template.\n4. A `..._subject.txt` template which generates the subject line of the email (it's also a template so you can use variables etc. in it).\n\nFirst copy the example \"general design\" template files into your project's templates path, naming them as you like. Copy them from:\n\n* [htmlemailer/templates/htmlemailer/example_template.txt](htmlemailer/templates/htmlemailer/example_template.txt)\n* [htmlemailer/templates/htmlemailer/example_template.html](htmlemailer/templates/htmlemailer/example_template.html)\n\nThen copy the example \"actual content\" template files into your project:\n\n* [htmlemailer/templates/htmlemailer/example_subject.txt](htmlemailer/templates/htmlemailer/example_subject.txt)\n\nand either\n\n* [htmlemailer/templates/htmlemailer/example.md](htmlemailer/templates/htmlemailer/example.md)\n\nif you want to use a single Markdown file or\n\n* [htmlemailer/templates/htmlemailer/example.txt](htmlemailer/templates/htmlemailer/example.txt)\n* [htmlemailer/templates/htmlemailer/example.html](htmlemailer/templates/htmlemailer/example.html)\n\nif you want to explicitly set the text and HTML parts of the message separately.\n\nYou can change the path and file names, except the set of files must have the *same* path name up to `.md`, `.txt`, `.html`, and `_subject.txt`. That's how the module knows they go together (note how you don't include the file extension in the call to `send_mail`).\n\nIf you changed the path of the general design templates, you'll have to update the `{% extends ... %}` template tags in `example.md` or `example.txt` and `example.html` to point to the new path. You can of course have more than one email by creating a new set of `.md`, `.txt`, `.html`, and `_subject.txt` files at a different path.\n\nLastly, in your call to `send_mail`, update the first argument to specify the location of your email templates. Just specify the common part of the path name of the three files. In this case, it's just `htmlemailer/example`. The `.md`, `.txt`, `.html`, and `_subject.txt` will be added by the library.\n\nAdvanced Usage\n--------------\n\n`send_mail` also takes an optional `fail_silently` boolean argument (default is False), and it passes other keyword arguments on to Django's [EmailMessage](https://docs.djangoproject.com/en/1.7/topics/email/#django.core.mail.EmailMessage) constructor, so you can also pass `headers` and `connection`.\n\nIf `DEFAULT_TEMPLATE_CONTEXT` is set in your settings, then it should be a dictionary with default template context variables passed into your email templates.\n\nNotes on Markdown\n-----------------\n\nMarkdown messages are rendered into HTML using CommonMark ([specification](http://spec.commonmark.org/), [library](https://pypi.python.org/pypi/CommonMark)). The text part of the message is rendered using a special Markdown-to-text renderer, because raw Markdown doesn't always look professional (especially links and images).\n\nThe Markdown is rendered *first* prior to running the Django template engine. So you cannot cause Markdown to be inserted into the email through template context variables. This is by design.\n\nAlso note that the `{% extends ... %}` tag at the top of the Markdown message body template does not contain the `.txt` or `.html` file extension. The library inserts the right file extension for the general design template prior to rendering into HTML and text.\n\nNote: The CommonMark library is monkey-patched to turn off escaping of {'s and }'s in URLs (to allow for template tags to appear within links). If you are using CommonMark elsewhere in your application, that might affect you if you are creating Markdown documents with these characters in URLs (which is probably bad anyway).\n\nTesting (Library Developers)\n----------------------------\n\nA test Django project is included. To use:\n\n\tcd test_project\n\tpip3 install pynliner commonmark commonmarkextensions\n\tpython3 manage.py test_html_email example\n\tpython3 manage.py test_html_email example2\n\nThis will output test emails (a MIME message) to the console. `example` uses separate text and HTML parts. `example2` uses a single Markdown body file.\n\nLicense\n-------\n\nThis project and the (upstream) boilerplate code are available under the MIT license.\n\nFor Project Maintainers\n-----------------------\n\nTo publish a universal wheel to pypi:\n\n pip3 install twine\n rm -rf dist\n python3 setup.py sdist bdist_wheel --universal\n twine upload dist/*\n git tag v1.0.XXX\n git push --tags\n\n\n", "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/if-then-fund/django-html-emailer", "keywords": "Django email HTML", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-html-emailer", "package_url": "https://pypi.org/project/django-html-emailer/", "platform": "", "project_url": "https://pypi.org/project/django-html-emailer/", "project_urls": { "Homepage": "https://github.com/if-then-fund/django-html-emailer" }, "release_url": "https://pypi.org/project/django-html-emailer/0.0.8.1/", "requires_dist": [ "pynliner", "commonmark (>=0.8.0)", "commonmarkextensions (>=0.0.5)" ], "requires_python": "", "summary": "Utility for sending HTML emails from Django.", "version": "0.0.8.1" }, "last_serial": 4710344, "releases": { "0.0.4": [ { "comment_text": "", "digests": { "md5": "83537881165b846e5450b0ddc282d44f", "sha256": "d7db3f96a69b3004ed80631d94ef87f5c59fc9b65a2aab4f6a4272718256c35b" }, "downloads": -1, "filename": "django_html_emailer-0.0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "83537881165b846e5450b0ddc282d44f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14660, "upload_time": "2017-11-03T18:41:56", "url": "https://files.pythonhosted.org/packages/95/67/780d86acdcd39485caf25e301a7ebafdfef42281ae14e76b11966e4de615/django_html_emailer-0.0.4-py2.py3-none-any.whl" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "94f6400f8a84dd3d9510bfbacbda4c73", "sha256": "5dc187fed5060b3d21e5c04061dc9becb121ee1898c635880b0bdc199d0f1054" }, "downloads": -1, "filename": "django_html_emailer-0.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "94f6400f8a84dd3d9510bfbacbda4c73", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14667, "upload_time": "2017-12-03T22:15:00", "url": "https://files.pythonhosted.org/packages/0a/1e/27a683f514e1e1217d5b61c4e38876458ff628fde6e2e39e7bb2679f53b1/django_html_emailer-0.0.5-py2.py3-none-any.whl" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "6cdbc3b8ecd11f136ab95e52c000e76f", "sha256": "638b479327860589f70723340cb1e972f2e011d500818ed90ce1f3a7ecce500e" }, "downloads": -1, "filename": "django_html_emailer-0.0.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6cdbc3b8ecd11f136ab95e52c000e76f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14677, "upload_time": "2018-03-15T21:22:02", "url": "https://files.pythonhosted.org/packages/55/0b/0ffe53be11c37265004d0416c5a597233e636a14866861b6707f75014e1c/django_html_emailer-0.0.6-py2.py3-none-any.whl" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "2759eac378e76d91febbf12a2b08c2c1", "sha256": "949cd124b53f2dbc29c07e003a3ce32b29a67a37307c96ca625fef04a85d1af2" }, "downloads": -1, "filename": "django_html_emailer-0.0.7-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2759eac378e76d91febbf12a2b08c2c1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14642, "upload_time": "2018-09-03T21:32:58", "url": "https://files.pythonhosted.org/packages/65/d4/81fed0cfa83869a41cec765f0d19c39182cf29898e46416a2f003666a433/django_html_emailer-0.0.7-py2.py3-none-any.whl" } ], "0.0.8.1": [ { "comment_text": "", "digests": { "md5": "67b8554d9df87b3cea39fdb0cc558863", "sha256": "1ea72561355587952d2f6582bff14cc3cfd27aaac52a4bce83e57eb8a8d90f1e" }, "downloads": -1, "filename": "django_html_emailer-0.0.8.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "67b8554d9df87b3cea39fdb0cc558863", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12262, "upload_time": "2019-01-18T00:44:55", "url": "https://files.pythonhosted.org/packages/b8/98/431f2d80e3a11fa70608a7a9a33339c0fc10001a931b1430517c2b5e58a9/django_html_emailer-0.0.8.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5ebc0a547f66eb1c9bae40dd76d9cfba", "sha256": "4d9954d67005843be1768fa39b6e6f1d2eff1ac2353cec7c742aff81bb613a46" }, "downloads": -1, "filename": "django-html-emailer-0.0.8.1.tar.gz", "has_sig": false, "md5_digest": "5ebc0a547f66eb1c9bae40dd76d9cfba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10965, "upload_time": "2019-01-18T00:44:57", "url": "https://files.pythonhosted.org/packages/5b/9e/0c063971dba5d94e6b11d0afeb09127c5fd4901dd722a73ad681e7c74a10/django-html-emailer-0.0.8.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "67b8554d9df87b3cea39fdb0cc558863", "sha256": "1ea72561355587952d2f6582bff14cc3cfd27aaac52a4bce83e57eb8a8d90f1e" }, "downloads": -1, "filename": "django_html_emailer-0.0.8.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "67b8554d9df87b3cea39fdb0cc558863", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12262, "upload_time": "2019-01-18T00:44:55", "url": "https://files.pythonhosted.org/packages/b8/98/431f2d80e3a11fa70608a7a9a33339c0fc10001a931b1430517c2b5e58a9/django_html_emailer-0.0.8.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5ebc0a547f66eb1c9bae40dd76d9cfba", "sha256": "4d9954d67005843be1768fa39b6e6f1d2eff1ac2353cec7c742aff81bb613a46" }, "downloads": -1, "filename": "django-html-emailer-0.0.8.1.tar.gz", "has_sig": false, "md5_digest": "5ebc0a547f66eb1c9bae40dd76d9cfba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10965, "upload_time": "2019-01-18T00:44:57", "url": "https://files.pythonhosted.org/packages/5b/9e/0c063971dba5d94e6b11d0afeb09127c5fd4901dd722a73ad681e7c74a10/django-html-emailer-0.0.8.1.tar.gz" } ] }