{
"info": {
"author": "Ben Davis",
"author_email": "code@bendavismedia",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Software Development :: Libraries :: Python Modules"
],
"description": "=====================\nDjango Template Email\n=====================\n\ndjango-template-email provides a set of tools that allows you to easily build \nplain-text or HTML emails using templates.\n\nUsage\n=====\nAfter installing django-templatee-email, add ``template_email`` to your \n``INSTALLED_APPS`` in ``settings.py``.\n\nTemplates\n---------\nAn email template is like any other django template. To use the template as an\nemail, however, you must load the \"email\" templatetag library and use its tags\nto define the different parts of the email. The email templatetag library \ngives you three different tags to use: ``subject``, ``body``, and \n``bodyhtml``, each with their respective ``endsubject``, ``endbody``, and \n``endbodyhtml``.\n\nFor example ::\n \n {% load email %}\n {% subject %}Thank you for signing up!{% endsubject %}\n {% body %}\n Hello, {{ first_name }}.\n\n Thank you for signing up. To find out more information, please visit\n http://www.example.com/foo/.\n\n Sincerely, \n The Team\n {% endbody %}\n {% bodyhtml %}\n Hello, {{ first_name }}.\n\n Thank you for signing up. To find out more information, click\n here.\n {% endbodyhtml %}\n\nEach tag is entirely optional. You can set any part of the email as you \nnormally would with Djanog's EmailMessage class.\n\nSending Email\n-------------------\nThe TemplateEmail class is a subclass of \ndjango.core.mail.EmailMultiAlternatives, which itself is a subclass of\ndjango.core.mail.EmailMessage.\n\nTo send your email template as an email, simply instantiate the TemplateEmail \nclass while passing it your template and (optionally) a context dict::\n\n from template_email import TemplateEmail\n \n context = {'first_name': user.first_name}\n email = TemplateEmail(template='email/confirmation_message.html', context)\n email.send()\n\n\nTemplateEmail Class\n-------------------\nOf course, you may also extend the TemplateEmail class to suit your needs. \nThe TemplateEmail class is initialized with optional keyword arguments\nof ``template`` and ``context``. However, template and context variables may be\noverridden as a property as well. The TemplateEmail class has the following\nproperties:\n \n* ``template``: The template used to render the email\n* ``context``: The context provided to the template\n* ``subject``: The subject of the email\n* ``body``: The plan-text body of the email\n* ``html``: The html to attach as an alternative type\n\nThe ``subject``, ``body``, and ``html`` properties are intended as defaults,\nand will be overridden by whatever is given in the template.\n\nWhen you call the ``send()`` method, the TemplateEmail class first renders the \ngiven template into the different parts of the email. The templatetags simply\ndump their contents into temporary context variables for the ``render()`` method\nuse. The render method then renders the contents of each tag separately into \nthe class's ``subject``, ``body``, and ``bodyhtml`` properties. \n\nAs a convienience, the ``send()`` method will automatically convert User model\ninstances to email recipients, formatting them as \"first_name last_name \n\".",
"description_content_type": null,
"docs_url": null,
"download_url": "UNKNOWN",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "http://github.com/bendavis78/django-template-email",
"keywords": "savid",
"license": "UNKNOWN",
"maintainer": null,
"maintainer_email": null,
"name": "django-template-email",
"package_url": "https://pypi.org/project/django-template-email/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/django-template-email/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "http://github.com/bendavis78/django-template-email"
},
"release_url": "https://pypi.org/project/django-template-email/0.1/",
"requires_dist": null,
"requires_python": null,
"summary": "A useful tool for building email messages using django templates",
"version": "0.1"
},
"last_serial": 945100,
"releases": {
"0.1": [
{
"comment_text": "",
"digests": {
"md5": "e060727cf234c52f38f8444077a750c5",
"sha256": "9d819fb32146a4d40b4926010a48d42d7058722e243075627c5754df88f5fe79"
},
"downloads": -1,
"filename": "django-template-email-0.1.tar.gz",
"has_sig": false,
"md5_digest": "e060727cf234c52f38f8444077a750c5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3670,
"upload_time": "2013-12-15T19:13:27",
"url": "https://files.pythonhosted.org/packages/2b/df/238037cc0d83b0155414612c3cb7d3a557a97ec314a7107c7996c4bc2163/django-template-email-0.1.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "e060727cf234c52f38f8444077a750c5",
"sha256": "9d819fb32146a4d40b4926010a48d42d7058722e243075627c5754df88f5fe79"
},
"downloads": -1,
"filename": "django-template-email-0.1.tar.gz",
"has_sig": false,
"md5_digest": "e060727cf234c52f38f8444077a750c5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3670,
"upload_time": "2013-12-15T19:13:27",
"url": "https://files.pythonhosted.org/packages/2b/df/238037cc0d83b0155414612c3cb7d3a557a97ec314a7107c7996c4bc2163/django-template-email-0.1.tar.gz"
}
]
}