{ "info": { "author": "Arthur Chang", "author_email": "arthurc0102@gmail.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 3" ], "description": "# Ponddy Email Notification\n\nPonddy email notification package.\n\n## Installation\n\nInstall with `pip`\n\n```\npip install ponddy-email-notification\n```\n\nAdd this app to `INSTALLED_APPS` in `settings.py`\n\n```python\nINSTALLED_APPS = [\n ...\n 'email_notifications',\n]\n```\n\n## Usage\n\nMigrate database\n\n```\npython manage.py migrate\n```\n\nConfig email in `settings.py` check this at [Django Docs](https://docs.djangoproject.com/en/2.2/ref/settings/#std:setting-EMAIL_HOST)\n\n\nSetup urls in `urls.py`\n\n```python\nfrom django.urls import path\n\nfrom email_notifications.views import UnsubscribeView, UnsubscribeDoneView\n\n\nurlpatterns = [\n ...\n path(\n 'unsubscribe//',\n UnsubscribeView.as_view(),\n name='unsubscribe',\n ),\n path(\n 'unsubscribe/done/',\n UnsubscribeDoneView.as_view(),\n name='unsubscribe_done',\n ),\n]\n```\n\n**Now you can send email notification with admin!!!**\n\nAlso we support django template, your can get user with `user` and unsubscribe link with `unsubscribe_link`, for example\n\n```\nSubject -> 'Hi, {{ user.username }}\nMessage -> '............ unsubscribe with: {{ unsubscribe_link }}'\nHTML message -> '........... Click here to unsubscribe'\n```\n\n## Customization\n\nIf you want to custom unsubscribe url name (default is `unsubscribe`), add `UNSUBSCRIBE_URL` in `settings.py`\n\n```python\nUNSUBSCRIBE_URL='{{ your unsubscribe url name }}'\n```\n\nIf you want to custom unsubscribe done url name (default is `unsubscribe_done`), config it in `.as_view()` function\n\n```python\nUnsubscribeView.as_view(success_url='{{ your unsubscribe done url name }}')\n```\n\nIf you want to custom templates, config it in `.as_view()` function\n\n```python\nUnsubscribeView.as_view(template_name='{{ your template name}}')\nUnsubscribeDoneView.as_view(template_name='{{ your template name}}')\n```\n\n# Example\n\nIf you want to send notification with python script\n\n```python\nfrom django.contrib.auth import get_user_model\n\nfrom email_notifications.models import Notification\nfrom email_notifications.services import send_notification\n\n\nUser = get_user_model()\n\n\nnotification = Notification.objects.create(\n subject='Hi, {{ user.username }}',\n message='............ unsubscribe with: {{ unsubscribe_link }}',\n html_message='........... Click here to unsubscribe',\n)\nnotification.users.add(User.objects.all()) # We will automatic exclude user, if unsubscribe or no email.\nsend_notification('http://127.0.0.1:8000', notification)\n```\n\nor in view\n\n```python\nfrom django.contrib.auth import get_user_model\nfrom django.http import HttpResponse\n\nfrom email_notifications.models import Notification\nfrom email_notifications.services import send_notification\n\n\nUser = get_user_model()\n\n\ndef example_view(request):\n notification = Notification.objects.create(\n subject='Hi, {{ user.username }}',\n message='............ unsubscribe with: {{ unsubscribe_link }}',\n html_message='........... Click here to unsubscribe',\n )\n notification.users.add(User.objects.all()) # We will automatic exclude user, if unsubscribe or no email.\n send_notification(request.build_absolute_uri('/'), notification)\n return HttpResponse('ok')\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ponddy-edu/ponddy-email-notification", "keywords": "ponddy", "license": "", "maintainer": "", "maintainer_email": "", "name": "ponddy-email-notification", "package_url": "https://pypi.org/project/ponddy-email-notification/", "platform": "", "project_url": "https://pypi.org/project/ponddy-email-notification/", "project_urls": { "Homepage": "https://github.com/ponddy-edu/ponddy-email-notification" }, "release_url": "https://pypi.org/project/ponddy-email-notification/0.0.4/", "requires_dist": [ "django" ], "requires_python": "", "summary": "Ponddy email notification package", "version": "0.0.4" }, "last_serial": 5848242, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "ac4a2cd648b756717a7dd626b756db10", "sha256": "67f4e2996335e962e2c3e8bdb6aecbd8ae4591f2270fea0ab03cd55414c5297b" }, "downloads": -1, "filename": "ponddy_email_notification-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ac4a2cd648b756717a7dd626b756db10", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7335, "upload_time": "2019-09-18T01:47:18", "url": "https://files.pythonhosted.org/packages/d5/48/72d6dfc2bb86a69c5e5b80a3f9bef6a7fe797036e09616c8688d13ce33a5/ponddy_email_notification-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f18db37213ac5183b71fa5b8355becdb", "sha256": "27c3c8ba355f64bb841885428fe7daf876a657eb12c7836797e5f803753c571e" }, "downloads": -1, "filename": "ponddy-email-notification-0.0.1.tar.gz", "has_sig": false, "md5_digest": "f18db37213ac5183b71fa5b8355becdb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4331, "upload_time": "2019-09-18T01:47:19", "url": "https://files.pythonhosted.org/packages/34/76/b186b8d85ea72db25d7ee63a34026d26ee0b8fb825158643578f01180c64/ponddy-email-notification-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "3e319ee2e422ab161e5fb522f14a6698", "sha256": "27e7a4eda66cd1344fc1fbb17a37b9542a5ac24ff3fb8362ee66e208c26fd7dc" }, "downloads": -1, "filename": "ponddy_email_notification-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "3e319ee2e422ab161e5fb522f14a6698", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7353, "upload_time": "2019-09-18T03:11:08", "url": "https://files.pythonhosted.org/packages/2f/ea/26d259a4c987b6bd93569b82caf947af42dad9f58863c7432be99c7028f7/ponddy_email_notification-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4a8dbad8ac73f3ed306cf440553728d7", "sha256": "1d1b0e0e33b25407d8b7b738a48af7551caf739db63b9a6dda0efaec58c45e4d" }, "downloads": -1, "filename": "ponddy-email-notification-0.0.2.tar.gz", "has_sig": false, "md5_digest": "4a8dbad8ac73f3ed306cf440553728d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4347, "upload_time": "2019-09-18T03:11:10", "url": "https://files.pythonhosted.org/packages/24/54/edfb90d2e4254d00098335f25e3ec5ab06a157b22119d11fa25176be8d66/ponddy-email-notification-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "96ba1c0696d1fe653116cc231f1df999", "sha256": "edee52a2d361117e6ffe1cbd7dc6df0bbb4d8742852afb5d29b02f8314a58ca5" }, "downloads": -1, "filename": "ponddy_email_notification-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "96ba1c0696d1fe653116cc231f1df999", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8342, "upload_time": "2019-09-18T04:28:46", "url": "https://files.pythonhosted.org/packages/df/d1/52be57dda35d7df132939694d0cbe8f3f070d4ee44dd63110e05c160985d/ponddy_email_notification-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9310b72cdd67d3801bf5765c83fb6f0a", "sha256": "b8ee1e57ef877c0a524ddbd0a9687af94a35f8a2d5069d519d659fd139f87f0b" }, "downloads": -1, "filename": "ponddy-email-notification-0.0.3.tar.gz", "has_sig": false, "md5_digest": "9310b72cdd67d3801bf5765c83fb6f0a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5539, "upload_time": "2019-09-18T04:28:48", "url": "https://files.pythonhosted.org/packages/b1/1a/76cb9b3b936799870396b5b9f4c3fdd712e25e9a3de48a8b2535e7990d99/ponddy-email-notification-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "794f1ceec031992ada2a0b5946f96d4f", "sha256": "0871460894f1daf74af690e07be898da1ddaa2aa7b8f38af62ce69ccdd0fab53" }, "downloads": -1, "filename": "ponddy_email_notification-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "794f1ceec031992ada2a0b5946f96d4f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8343, "upload_time": "2019-09-18T07:20:21", "url": "https://files.pythonhosted.org/packages/1f/f4/b57497672054f5566a522d93f39eb8f7901d3074c50612e40e3d820b97f0/ponddy_email_notification-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f4434a7e96b10953be6309bb1575a5af", "sha256": "79324ac32e7373b4bf80dec01faae7157c5da2e7a8ec368aedb50bd3ea15a4af" }, "downloads": -1, "filename": "ponddy-email-notification-0.0.4.tar.gz", "has_sig": false, "md5_digest": "f4434a7e96b10953be6309bb1575a5af", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5536, "upload_time": "2019-09-18T07:20:23", "url": "https://files.pythonhosted.org/packages/cc/20/4094c2f771f031ed95eaf85a2b97ee8b8d413af53b91bfdd7187061f2c36/ponddy-email-notification-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "794f1ceec031992ada2a0b5946f96d4f", "sha256": "0871460894f1daf74af690e07be898da1ddaa2aa7b8f38af62ce69ccdd0fab53" }, "downloads": -1, "filename": "ponddy_email_notification-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "794f1ceec031992ada2a0b5946f96d4f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8343, "upload_time": "2019-09-18T07:20:21", "url": "https://files.pythonhosted.org/packages/1f/f4/b57497672054f5566a522d93f39eb8f7901d3074c50612e40e3d820b97f0/ponddy_email_notification-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f4434a7e96b10953be6309bb1575a5af", "sha256": "79324ac32e7373b4bf80dec01faae7157c5da2e7a8ec368aedb50bd3ea15a4af" }, "downloads": -1, "filename": "ponddy-email-notification-0.0.4.tar.gz", "has_sig": false, "md5_digest": "f4434a7e96b10953be6309bb1575a5af", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5536, "upload_time": "2019-09-18T07:20:23", "url": "https://files.pythonhosted.org/packages/cc/20/4094c2f771f031ed95eaf85a2b97ee8b8d413af53b91bfdd7187061f2c36/ponddy-email-notification-0.0.4.tar.gz" } ] }