{ "info": { "author": "Michael Handerek", "author_email": "michael@handerek.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Topic :: Internet :: WWW/HTTP" ], "description": "# django-mailto\n\ndjango-mailto is a simple reusable Django app, which enables you to send, manage and queue the sending of templated\nand multilingual emails.\n\nQueueing is an optional feature, which will be enabled when [celery - Distributed Task Queue](https://github.com/celery/celery) \nis up and running within your project.\n\n## Dependencies\n\n- [Django >= 1.4](https://www.djangoproject.com/)\n- [Celery >= 3.0.0](http://www.celeryproject.org/) (optional)\n\n## Features\n\n- simple interface `mailto(['test@localhost'], 'test')`\n- inline editing of HTML mails\n- send mails asynchron\n- Opt-In/-Out\n\n## Getting started\n\n1. `pip install django-mailto`\n\n2. Add `mailto` to your `INSTALLED_APPS` settings:\n\n ```\n INSTALLED_APPS = (\n ...\n 'mailto',\n )\n ```\n\n3. And add it to your urls:\n\n ```\n urlpatterns += patterns('',\n url(r'^mailto/', include('mailto.urls')),\n )\n ```\n\n4. Finally run `manage.py syncdb`.\n\n\n## Usage\n\n`mailto(recipients, slug, language_code=settings.LANGUAGE_CODE, context={}, from_email=None, reply_to=None, cc=[], bcc=[], headers={}, attachments=[])`\n\nParameters:\n\n- **recipients** (list) - A list of recipeint addresses.\n- **slug** (string) - Slug of Mail object to be sent.\n- **language_code** (string) - Language code.\n- **context** (dict) - A dictionary of additional context.\n- **from_email** (string) - Senders email address, will override `sender_email` attribute of an existing Mail object.\n- **reply_to** (string) - Reply-To email address, will override `reply_to` attribute of an existing Mail object.\n- **cc** (list) - A list of recipient addresses., will extend `cc` attribute of an existing Mail object.\n- **bcc** (list) - A list of recipient address, will extend `bcc` attribute of an existing Mail object.\n- **headers** (dict) - A dictionary of extra headers to put on the message. The keys are the header name, values are the \n header values. It\u2019s up to the caller to ensure header names and values are in the correct format for an email message.\n- **attachment** (list) - A list of attachments to put on the message. These can be either `email.MIMEBase.MIMEBase` instances, or \n `(filename, content, mimetype)` triples.\n\n```\nfrom mailto import mailto\n\nmailto(['test@localhost'], 'test')\n```\n\nIn case, Mail object with given slug does not exist, it will be created with `active=False`, without sending. In order to provide an initial set of Mail objects specify `MAILTO_MAILS` setting in your settings file, which will be created on `syncdb`.\n \n### In your templates \n\nLoad `mailtotags` into your template and define placeholders where content should be editable. A minimal template with a simple footer would look like this (e.g. `mailto/simple_footer.html`):\n\n```\n{% extends 'mailto/base.html' %}\n{% load mailtotags %}\n\n{% block title %}{{ block.super }}{% endblock %}\n{% block extra_head %}{{ block.super }}{% endblock %}\n{% block extra_body_attrs %}{{ block.super }}{% endblock %}\n\n{% block body %}\n {% placeholder 'main-content' %}\n \n