{ "info": { "author": "SF Software limited t/a Pebble", "author_email": "sysadmin@talktopebble.co.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "==========\nDjango-Templated-Email\n==========\n:Info: A Django oriented templated email sending class\n:Author: Bradley Whittington (http://github.com/bradwhittington, http://twitter.com/darb)\n:Tests: .. image:: https://api.travis-ci.org/bradwhittington/django-templated-email.png\n\nOverview\n=================\n\nThis is a fork of django-templated-email so we can keep a version in pypi\nwhich works with the latest version of Django.\n\ndjango-templated-email is oriented towards sending templated emails\nintended for use with transactional mailers (with support for MailchimpSTS,\nand PostageApp), but as a default with a backend class which uses django's\ntemplating system, and django's core.mail functions. The library supports\ntemplate inheritence, adding cc'd and bcc'd recipients, configurable\ntemplate naming and location, with easy switching between backends/providers.\n\nThe send_templated_email method can be thought of as the render_to_response\nshortcut for email.\n\nGetting going - installation\n=============\n\nInstalling::\n\n pip install django-templated-email\n\nYou can add the following to your settings.py (but it works out the box)::\n\n TEMPLATED_EMAIL_BACKEND = 'templated_email.backends.vanilla_django.TemplateBackend'\n\n # You can use a shortcut version\n TEMPLATED_EMAIL_BACKEND = 'templated_email.backends.vanilla_django'\n\n # You can also use a class directly\n from templated_email.backends.vanilla_django import TemplateBackend\n TEMPLATED_EMAIL_BACKEND = TemplateBackend\n\n\nSending templated emails\n=============\n\nExample usage using vanilla_django TemplateBackend backend\n\nPython to send mail::\n\n from templated_email import send_templated_mail\n send_templated_mail(\n template_name='welcome',\n from_email='from@example.com',\n recipient_list=['to@example.com'],\n context={\n 'username':request.user.username,\n 'full_name':request.user.get_full_name(),\n 'signup_date':request.user.date_joined\n },\n # Optional:\n # cc=['cc@example.com'],\n # bcc=['bcc@example.com'],\n # headers={'My-Custom-Header':'Custom Value'},\n # template_prefix=\"my_emails/\",\n # template_suffix=\"email\",\n )\n\nIf you would like finer control on sending the email, you can use **get_templated_email**, which will return a django **EmailMessage** object, prepared using the **vanilla_django** backend::\n\n from templated_email import get_templated_mail\n get_templated_mail(\n template_name='welcome',\n from_email='from@example.com',\n to=['to@example.com'],\n context={\n 'username':request.user.username,\n 'full_name':request.user.get_full_name(),\n 'signup_date':request.user.date_joined\n },\n # Optional:\n # cc=['cc@example.com'],\n # bcc=['bcc@example.com'],\n # headers={'My-Custom-Header':'Custom Value'},\n # template_prefix=\"my_emails/\",\n # template_suffix=\"email\",\n )\n\nYou can also **cc** and **bcc** recipients using **cc=['example@example.com']**. Some backends have other parameters you can override, see below.\n\nYour template\n-------------\n\nThe templated_email/ directory needs to be the templates directory.\n\nThe backend will look in *my_app/templates/templated_email/welcome.email* ::\n\n {% block subject %}My subject for {{username}}{% endblock %}\n {% block plain %}\n Hi {{full_name}},\n\n You just signed up for my website, using:\n username: {{username}}\n join date: {{signup_date}}\n\n Thanks, you rock!\n {% endblock %}\n\nIf you want to include an HTML part to your emails, simply use the 'html' block ::\n\n {% block html %}\n

Hi {{full_name}},

\n\n

You just signed up for my website, using:\n

\n
username
{{username}}
\n
join date
{{signup_date}}
\n
\n

\n\n

Thanks, you rock!

\n {% endblock %}\n\nYou can globally override the template dir, and file extension using the following variables in settings.py ::\n\n TEMPLATED_EMAIL_TEMPLATE_DIR = 'templated_email/' # use '' for top level template dir, ensure there is a trailing slash\n TEMPLATED_EMAIL_FILE_EXTENSION = 'email'\n\nFor the **vanilla_django** and **mailchimp_sts** backends you can set a value for **template_prefix** and **template_suffix** (or use the less backend-portable **template_dir** / **file_extension**) for every time you call **send_templated_mail**, if you wish to store a set of templates in a different directory. Remember to include a trailing slash.\n\nPlease note / Warning about template inheritence\n-------------\nThere is very basic support for template inheritence (using **{% extends ... %}** in templates). You will run into issues if you use **{{block.super}}**, and will result in blank parts of emails.\n\nLegacy Behaviour\n----------------\n\nThe 0.2.x version of the library looked in django template directories/loaders\nfor **templated_email/welcome.txt** ::\n\n Hey {{full_name}},\n\n You just signed up for my website, using:\n username: {{username}}\n join date: {{signup_date}}\n\n Thanks, you rock!\n\nIt will use **templated_email/welcome.html** for the html part\nof the email allowing you to make it so much pretty.\n\nFuture Plans\n------------\n\nSee https://github.com/bradwhittington/django-templated-email/issues?state=open\n\nUsing django_templated_email in 3rd party applications:\n=============\n\nIf you would like to use django_templated_email to handle mail in a reusable application, you should note that:\n\n* Your calls to **send_templated_mail** should set a value for **template_dir**, so you can keep copies of your app-specific templates local to your app (although the loader will find your email templates if you store them in */templates/templated_email*, if **TEMPLATED_EMAIL_TEMPLATE_DIR** has not been overidden)\n* If you do (and you should) set a value for **template_dir**, remember to include a trailing slash, i.e. *'my_app_email/'*\n* The deployed app may use a different backend which doesn't use the django templating backend, and as such make a note in your README warning developers that if they are using django_templated_email already, with a different backend, they will need to ensure their email provider can send all your templates (ideally enumerate those somewhere convenient)\n\nNotes on specific backends:\n=============\n\nUsing vanilla_django:\n-------------\n\nThis is the default backend, and as such requires no special configuration, and will work out of the box. By default it assumes the following settings (should you wish to override them)::\n\n TEMPLATED_EMAIL_TEMPLATE_DIR = 'templated_email/' # Use '' for top level template dir\n TEMPLATED_EMAIL_FILE_EXTENSION = 'email'\n\nFor legacy purposes you can specify email subjects in your settings file (but, the preferred method is to use a **{% block subject %}** in your template)::\n\n TEMPLATED_EMAIL_DJANGO_SUBJECTS = {\n 'welcome':'Welcome to my website',\n }\n\nAdditionally you can call **send_templated_mail** and optionally override the following parameters::\n\n template_prefix='your_template_dir/' # Override where the method looks for email templates (alternatively, use template_dir)\n template_suffix='email' # Override the file extension of the email templates (alternatively, use file_extension)\n cc=['fubar@example.com'] # Set a CC on the mail\n bcc=['fubar@example.com'] # Set a BCC on the mail\n template_dir='your_template_dir/' # Override where the method looks for email templates\n connection=your_connection # Takes a django mail backend connection, created using **django.core.mail.get_connection**\n auth_user='username' # Override the user that the django mail backend uses, per **django.core.mail.send_mail**\n auth_password='password' # Override the password that the django mail backend uses, per **django.core.mail.send_mail**\n\nUsing PostageApp:\n-------------\n\nTo use the PostageApp (http://postageapp.com) send method, you will need to install python-postageapp::\n\n pip install -e git://github.com/bradwhittington/python-postageapp.git#egg=postageapp\n\nAnd add the following to your settings.py::\n\n TEMPLATED_EMAIL_BACKEND = 'templated_email.backends.postageapp_backend.TemplateBackend'\n\n POSTAGEAPP_API_KEY = 'yourapikey'\n\n # If you are already using django-postageapp:\n\n EMAIL_POSTAGEAPP_API_KEY = POSTAGEAPP_API_KEY\n\nUsing MAILCHIMP STS:\n-------------\n\nTo use the MailChimp STS send method, you will need to install mailsnake (please note, until the main mailsnake has STS support, you need to use my fork)::\n\n pip install -e git://github.com/nitinhayaran/greatape.git#egg=greatape\n\nAnd add the following to your settings.py::\n\n TEMPLATED_EMAIL_BACKEND = 'templated_email.backends.mailchimp_sts.TemplateBackend'\n\n MAILCHIMP_API_KEY = 'yourapikey'\n\n # For the django back-end specifically\n TEMPLATED_EMAIL_MAILCHIMP = {\n 'welcome':{\n 'subject':'Welcome to my website',\n 'track_opens':True,\n 'track_clicks':False,\n 'tags':['my','little','pony'],\n }\n }\n\nThe Mailchimp STS sender uses the same template processor as the VanillaDjango backend, so you can override the following settings globally::\n\n TEMPLATED_EMAIL_TEMPLATE_DIR = 'templated_email/' #use '' for top level template dir\n TEMPLATED_EMAIL_FILE_EXTENSION = 'email'\n\nYou can also override the *template_dir* variable when calling *send_templated_mail*\n\n.. _Django: http://djangoproject.com\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/mypebble/django-templated-email/", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-templated-email-pebble", "package_url": "https://pypi.org/project/django-templated-email-pebble/", "platform": "any", "project_url": "https://pypi.org/project/django-templated-email-pebble/", "project_urls": { "Homepage": "http://github.com/mypebble/django-templated-email/" }, "release_url": "https://pypi.org/project/django-templated-email-pebble/2.0.2/", "requires_dist": null, "requires_python": "", "summary": "Pebble's fork of a Django oriented templated / transaction email abstraction", "version": "2.0.2" }, "last_serial": 2373355, "releases": { "0.5.0": [ { "comment_text": "", "digests": { "md5": "cf4278658778973c77c3c885dc9863f4", "sha256": "07e943c5a27a6f3da1dfa485929e85500bb7515e9d668628f5f01378ab41621d" }, "downloads": -1, "filename": "django-templated-email-pebble-0.5.0.tar.gz", "has_sig": false, "md5_digest": "cf4278658778973c77c3c885dc9863f4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12652, "upload_time": "2015-07-28T13:00:57", "url": "https://files.pythonhosted.org/packages/a2/62/c95bf97c509e65402cf7e1cf7d6013dd652904e4fd016affb9cccccdc51c/django-templated-email-pebble-0.5.0.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "e5e9ec2963e12bd300c8329f21a04265", "sha256": "9ef1d87a03276eedb7e6047c03a75dc126331073cd5c7442790442763a6cf9fb" }, "downloads": -1, "filename": "django-templated-email-pebble-0.6.0.tar.gz", "has_sig": false, "md5_digest": "e5e9ec2963e12bd300c8329f21a04265", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11774, "upload_time": "2015-09-22T15:01:55", "url": "https://files.pythonhosted.org/packages/54/e5/f991e59285f0a234f451c6a71c368a6c43195d56d05bd9d00bd23204b30e/django-templated-email-pebble-0.6.0.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "44f687a7bc104ab1a040c5517ca531fb", "sha256": "1832989b98e08786e0f6cf075b76b5be48bd8c815bbee930ab9c48a453c75528" }, "downloads": -1, "filename": "django_templated_email_pebble-2.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "44f687a7bc104ab1a040c5517ca531fb", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 15283, "upload_time": "2016-09-30T13:50:13", "url": "https://files.pythonhosted.org/packages/f7/2a/d04371c658d5f44a0ecb178f0ba6822efc83bbc6abdb353c5ec30d7c5a15/django_templated_email_pebble-2.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3730e6aac7bd70b740562600783dc848", "sha256": "9f4feaca0e787c49bd99164976f49067448554c69f02469111063ed5a0e467c5" }, "downloads": -1, "filename": "django-templated-email-pebble-2.0.0.tar.gz", "has_sig": false, "md5_digest": "3730e6aac7bd70b740562600783dc848", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9914, "upload_time": "2016-09-30T13:50:15", "url": "https://files.pythonhosted.org/packages/52/43/4d5c61c8d98245312a492f10a1368632df4644f215f41c3e3344afb1a4d0/django-templated-email-pebble-2.0.0.tar.gz" } ], "2.0.1": [ { "comment_text": "", "digests": { "md5": "3989c02115c45bd882891b0d761c6e37", "sha256": "c5b175de49590cba9fe1986e3e48ef81d0827dfea75517ec79011f9cab5cc614" }, "downloads": -1, "filename": "django_templated_email_pebble-2.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "3989c02115c45bd882891b0d761c6e37", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 15291, "upload_time": "2016-09-30T13:53:41", "url": "https://files.pythonhosted.org/packages/a7/99/a1e798461a27e6df999f87109ae64bc23ad1dd168d88eb6179e81201f642/django_templated_email_pebble-2.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "49a955c3a0696ad5082d3c22e814bf6e", "sha256": "113a73b820e2f0df777970859dffcad2b485d231fa42486a41576f760d47efdd" }, "downloads": -1, "filename": "django-templated-email-pebble-2.0.1.tar.gz", "has_sig": false, "md5_digest": "49a955c3a0696ad5082d3c22e814bf6e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9921, "upload_time": "2016-09-30T13:53:44", "url": "https://files.pythonhosted.org/packages/6f/dd/862d8944ab7fa19298082c8ee38e3bb78fd994c96e3a3c0185f6612e6d36/django-templated-email-pebble-2.0.1.tar.gz" } ], "2.0.2": [ { "comment_text": "", "digests": { "md5": "c53d496e71803efc69ce317257f032bf", "sha256": "18365536601e4fbc74dc844d4e7cb431e32f2525d00114e449cf7e3a6be9cbcc" }, "downloads": -1, "filename": "django_templated_email_pebble-2.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "c53d496e71803efc69ce317257f032bf", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 15291, "upload_time": "2016-09-30T14:15:24", "url": "https://files.pythonhosted.org/packages/c2/04/bbf1dd89ab116a0b7a4846563c054d5802e051215104d95ba35a1965be4a/django_templated_email_pebble-2.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fbd05dfc66a6013ed4f173a54c2a486b", "sha256": "d39b34e4b35f0b84daf0a95ada4e3e0e3d7d730d9199665a8e076cadfb455663" }, "downloads": -1, "filename": "django-templated-email-pebble-2.0.2.tar.gz", "has_sig": false, "md5_digest": "fbd05dfc66a6013ed4f173a54c2a486b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9929, "upload_time": "2016-09-30T14:15:27", "url": "https://files.pythonhosted.org/packages/38/4d/37aacde8bc6ac9d41c1b3b091f6a8b10b3f0630e19827fe268352353f118/django-templated-email-pebble-2.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c53d496e71803efc69ce317257f032bf", "sha256": "18365536601e4fbc74dc844d4e7cb431e32f2525d00114e449cf7e3a6be9cbcc" }, "downloads": -1, "filename": "django_templated_email_pebble-2.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "c53d496e71803efc69ce317257f032bf", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 15291, "upload_time": "2016-09-30T14:15:24", "url": "https://files.pythonhosted.org/packages/c2/04/bbf1dd89ab116a0b7a4846563c054d5802e051215104d95ba35a1965be4a/django_templated_email_pebble-2.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fbd05dfc66a6013ed4f173a54c2a486b", "sha256": "d39b34e4b35f0b84daf0a95ada4e3e0e3d7d730d9199665a8e076cadfb455663" }, "downloads": -1, "filename": "django-templated-email-pebble-2.0.2.tar.gz", "has_sig": false, "md5_digest": "fbd05dfc66a6013ed4f173a54c2a486b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9929, "upload_time": "2016-09-30T14:15:27", "url": "https://files.pythonhosted.org/packages/38/4d/37aacde8bc6ac9d41c1b3b091f6a8b10b3f0630e19827fe268352353f118/django-templated-email-pebble-2.0.2.tar.gz" } ] }