{ "info": { "author": "UNICEF", "author_email": "dev@unicef.org", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "Programming Language :: Python :: 3.6" ], "description": "# UNICEF Notification\n\nNotification is a library that provides handles sending of notifications.\n\n\n## Installation\n\n pip install unicef-notification\n\n\n## Setup\n\nAdd ``unicef_notification`` to ``INSTALLED_APPS`` in settings\n\n INSTALLED_APPS = [\n ...\n 'post_office',\n 'unicef_notification',\n ]\n\nAdd ``POST_OFFICE`` configuration to settings;\n\n POST_OFFICE = {\n 'DEFAULT_PRIORITY': 'now',\n 'BACKENDS': {\n 'default': 'djcelery_email.backends.CeleryEmailBackend'\n }\n }\n\nUpdate ``TEMPLATES`` in settings by adding ``EmailTemplateLoader`` and marking ``APP_DIRS`` as ``False``\n\n TEMPLATES = [\n ...\n 'APP_DIRS': False, # False because we set loaders manually below\n 'OPTIONS': {\n 'loaders': [\n ...\n 'django.template.loaders.app_directories.Loader',\n 'unicef_notification.loaders.EmailTemplateLoader',\n ],\n ...\n ]\n\n\n### Optional\n\nIf you want to override the notification template directory to be used;\n\n UNICEF_NOTIFICATION_TEMPLATE_DIR = 'notifications'\n\nThis is the directory where notifcation templates are to be placed in your applications.\nThese are loaded with the `upload_notifications` management command.\n\nIf you want to override the email template prefix;\n\n UNICEF_NOTIFICATION_EMAIL_TEMPLATE_PREFIX = 'email-templates/'\n\n## Usage\n\nCreate notification template in defined `UNICEF_NOTIFICATION_TEMPLATE_DIR` from setup.\n\n name = \"\n defaults = {\n \"description\": \"Sample notification\",\n \"subject\": \"Subject of notification\",\n \"content\": \"Content of notification\",\n \"html_content\": \"Notificaton content in HTML format\",\n }\n\nUpdate the notifications;\n\n python manage.py update_notifications\n\nSend notification with template;\n\n from unicef_notification.utils import send_notification_with_template\n\n context = {}\n send_notification_with_template(\n [\"to@example.com\"],\n \"\",\n context,\n )\n\nSend notification without a template;\n\n from unicef_notification.utils import send_notification\n\n send_notification(\n [\"to@example.com\"],\n subject=\"Subject of notification\",\n content=\"Content of notification\",\n html_content=\"Notification content in HTML format\",\n )\n\n\n## Contributing\n\n### Environment Setup\n\nTo install the necessary libraries\n\n $ make install\n\n\n### Coding Standards\n\nSee `PEP 8 Style Guide for Python Code `_ for complete details on the coding standards.\n\nTo run checks on the code to ensure code is in compliance\n\n $ make lint\n\n\n### Testing\n\nTesting is important and tests are located in `tests/` directory and can be run with;\n\n $ make test\n\nCoverage report is viewable in `build/coverage` directory, and can be generated with;\n\n\n### Project Links\n\n - Continuos Integration - https://circleci.com/gh/unicef/unicef-notification/tree/develop\n - Source Code - https://github.com/unicef/unicef-notification\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/unicef/unicef-notification", "keywords": "", "license": "Apache 2 License", "maintainer": "", "maintainer_email": "", "name": "unicef_notification", "package_url": "https://pypi.org/project/unicef_notification/", "platform": "any", "project_url": "https://pypi.org/project/unicef_notification/", "project_urls": { "Homepage": "https://github.com/unicef/unicef-notification" }, "release_url": "https://pypi.org/project/unicef_notification/0.2.1/", "requires_dist": null, "requires_python": "", "summary": "Django package that handles sending of notifications", "version": "0.2.1" }, "last_serial": 4149285, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "36cc4bdee73a4b9552fd3ea9e9ac1960", "sha256": "764c2d1869315fdbad4b057d4d752f2a5d4266fbe1677a1a9ec06ecec5e253bf" }, "downloads": -1, "filename": "unicef_notification-0.1.0.tar.gz", "has_sig": false, "md5_digest": "36cc4bdee73a4b9552fd3ea9e9ac1960", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15432, "upload_time": "2018-06-28T16:55:12", "url": "https://files.pythonhosted.org/packages/30/67/e8f3edab48c94b34d4267ed1efc8e1d25565ec59a04678ac0b7754e68780/unicef_notification-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "9dd33b545fcff10b7364cd58f453a8a4", "sha256": "06e8971eecae5a86a67aed75be4925aaddc9fac1ea82de02190a9b7a5c59e233" }, "downloads": -1, "filename": "unicef_notification-0.2.0.tar.gz", "has_sig": false, "md5_digest": "9dd33b545fcff10b7364cd58f453a8a4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16827, "upload_time": "2018-06-29T11:43:00", "url": "https://files.pythonhosted.org/packages/ac/37/c501d9360518ccc17972edab461610d9204f9347e459ea9dd6f380b94039/unicef_notification-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "8e703429a80a3d4d243132575517f342", "sha256": "a11cc3faadb75421f7b7e0f76d6696e604e8c1872411c4066833b6413932518f" }, "downloads": -1, "filename": "unicef_notification-0.2.1.tar.gz", "has_sig": false, "md5_digest": "8e703429a80a3d4d243132575517f342", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16822, "upload_time": "2018-08-08T14:52:16", "url": "https://files.pythonhosted.org/packages/35/af/77b5d12a9c2c0e3ea9c1b100c4cebac885ec859ddf28c5c96098f781fc9a/unicef_notification-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8e703429a80a3d4d243132575517f342", "sha256": "a11cc3faadb75421f7b7e0f76d6696e604e8c1872411c4066833b6413932518f" }, "downloads": -1, "filename": "unicef_notification-0.2.1.tar.gz", "has_sig": false, "md5_digest": "8e703429a80a3d4d243132575517f342", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16822, "upload_time": "2018-08-08T14:52:16", "url": "https://files.pythonhosted.org/packages/35/af/77b5d12a9c2c0e3ea9c1b100c4cebac885ec859ddf28c5c96098f781fc9a/unicef_notification-0.2.1.tar.gz" } ] }