{ "info": { "author": "Andrew McCloud", "author_email": "andrew@amccloud.com", "bugtrack_url": null, "classifiers": [ "Framework :: Django", "Intended Audience :: Developers", "Operating System :: OS Independent", "Topic :: Software Development" ], "description": "# Django Firstclass\nFirstclass is a proxy email backend for Django that allows for global email transformations\nsuch as automatically creating a plain text version of html emails or automatically creating\nan online version of the email that can be read in browser.\n\n## Install\n```bash\npip install django-firstclass\n```\n\n - Add ``'firstclass'`` to ``INSTALLED_APPS``\n - Add ``url(r'^email/', include('firstclass.urls'))`` to your urlconf.\n - Set ``EMAIL_BACKEND`` to ``'firstclass.backends.ProxyBackend'``\n - Syncdb\n\n## Settings\n### FIRSTCLASS_EMAIL_BACKEND\nThe email backend to send processed emails to after they've gone through the middleware.\n\n##### Default\n```python\nFIRSTCLASS_EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'\n```\n\n### FIRSTCLASS_MIDDLEWARE\nFirstclass middleware works just like Django middleware. Firstclass applies middleware\nin the order it's defined in ``FIRSTCLASS_MIDDLEWARE``, top-down. You can even create your\nown middleware. See: [Custom Middleware](#custom-middleware)\n\n##### Default\n```python\nFIRSTCLASS_MIDDLEWARE = (\n 'firstclass.middleware.online.ViewOnlineMiddleware',\n 'firstclass.middleware.alternative.MultiAlternativesMiddleware',\n 'firstclass.middleware.text.PlainTextMiddleware',\n)\n```\n\n## Available Middleware\n### PlainTextMiddleware\n``firstclass.middleware.text.PlainTextMiddleware``\n\n#### Settings\n##### FIRSTCLASS_PLAINTEXT_RULES\nA dictionary of rules for converting html to plain text. Keys should be a qualified\nselector for BeautifulSoup's ``findAll``. Values can either be a formatting string or\na function that accepts one argument, ``attrs``. All attributes found on the element\ncan be used for formatting or will be passed to your function in ``attrs``.\n\n##### Default\n```python\nFIRSTCLASS_PLAINTEXT_RULES = {\n 'a': '(%(text)s) %(href)s',\n 'img': '%(title)s: %(src)s',\n}\n```\n\n### MultiAlternativesMiddleware\n``firstclass.middleware.alternative.MultiAlternativesMiddleware``\n\nCoerces email to ``EmailMultiAlternatives`` so that a multiple versions of the\nemail can be added.\n\n### ViewOnlineMiddleware\n``firstclass.middleware.online.ViewOnlineMiddleware``\n\nSaves all emails and adds a link to the email body so that they can be viewed online\nin a web browser. Ideally this middleware should come before the ``PlainTextMiddlewware``\nso that the link that is added is converted to plain text.\n\n``ViewOnlineMiddleware`` uses the template ``firstclass/view_online_wrap.html`` to append\nthe link to the bottom of the email. You can override this by providing your own in your\ntemplates directory.\n\n#### Settings\n##### FIRSTCLASS_VIEWONLINE_AUTH\nIf this is ``True`` the user will need to be logged in to view email. The user's email would\nalso need to be one of the original recipients of the email.\n\n##### Default\n```python\nFIRSTCLASS_VIEWONLINE_AUTH = False\n```\n\n## Custom Middleware\nDefining custom middleware for Firstclass is simple. Middleware should be a single\nPython class that defines ``process_message``.\n\n### process_message\n``process_message(self, message)``\n\n``message`` is an [EmailMessage](https://docs.djangoproject.com/en/dev/topics/email/?from=olddocs/#emailmessage-objects)\nor an ``EmailMessage`` like object. ``process_message`` should return ``message``\nor ``None``. If it returns ``None`` the email will be dropped.\n\n## Views\n### view_message_online\n``firstclass.views.view_message_online(request, key, template='firstclass/message.html')``\n\nThis view is used by the ``ViewOnlineMiddleware`` middleware. It's template is\nlocated at ``firstclass/message.html``. You can override this by providing your own\nin your templates directory. The render context contains ``message`` which is ``Message``\nmodel instance.\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/amccloud/django-firstclass/", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-firstclass", "package_url": "https://pypi.org/project/django-firstclass/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-firstclass/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/amccloud/django-firstclass/" }, "release_url": "https://pypi.org/project/django-firstclass/0.9.1/", "requires_dist": null, "requires_python": null, "summary": "UNKNOWN", "version": "0.9.1" }, "last_serial": 789654, "releases": { "0.8": [ { "comment_text": "", "digests": { "md5": "022d6d58b91f8891d7f2bccce9133683", "sha256": "f30ba732762913a898a94a8d06c02c8ef0919763f7b6a7c62353f091df25bd17" }, "downloads": -1, "filename": "django-firstclass-0.8.tar.gz", "has_sig": false, "md5_digest": "022d6d58b91f8891d7f2bccce9133683", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3035, "upload_time": "2012-07-04T01:47:10", "url": "https://files.pythonhosted.org/packages/89/d4/913a812c6291a862d52af61e170023322ef4fb8771f76b41a23f5101ae14/django-firstclass-0.8.tar.gz" } ], "0.9": [ { "comment_text": "", "digests": { "md5": "ea609ab95e010f7e16a7de91593fa241", "sha256": "fbfc89593597f52c24e397b05fb1f055f69b64d94dfefc710dbe6d056921156f" }, "downloads": -1, "filename": "django-firstclass-0.9.tar.gz", "has_sig": false, "md5_digest": "ea609ab95e010f7e16a7de91593fa241", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5394, "upload_time": "2012-07-04T05:01:34", "url": "https://files.pythonhosted.org/packages/89/0a/a83145e88753eb18aa5108d80c422dc01d3d242fbb495102d215d80453a3/django-firstclass-0.9.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "e9da9b69847c45d6751df3ed46ce044f", "sha256": "c6c63d02d2fa3b290c7451ce8ca71a155e3be2afcd7e8fa96cd66b879f76e97a" }, "downloads": -1, "filename": "django-firstclass-0.9.1.tar.gz", "has_sig": false, "md5_digest": "e9da9b69847c45d6751df3ed46ce044f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6488, "upload_time": "2012-07-04T07:42:45", "url": "https://files.pythonhosted.org/packages/66/7e/de25f3adb0b448e380c0b6188dd6d6a209d11632c58d7df1fca3a275737a/django-firstclass-0.9.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e9da9b69847c45d6751df3ed46ce044f", "sha256": "c6c63d02d2fa3b290c7451ce8ca71a155e3be2afcd7e8fa96cd66b879f76e97a" }, "downloads": -1, "filename": "django-firstclass-0.9.1.tar.gz", "has_sig": false, "md5_digest": "e9da9b69847c45d6751df3ed46ce044f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6488, "upload_time": "2012-07-04T07:42:45", "url": "https://files.pythonhosted.org/packages/66/7e/de25f3adb0b448e380c0b6188dd6d6a209d11632c58d7df1fca3a275737a/django-firstclass-0.9.1.tar.gz" } ] }