{ "info": { "author": "Esteban Solorzano", "author_email": "estebansolorzano27@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# PYSGS\n\nThis is a small tool designed as part of learning, allows sending SendGrid messages via SMTP\n\n## Table of Contents\n- [Installation](#installation)\n- [Setup](#setup)\n - [Headers](#headers)\n - [Sender](#sender)\n- [Usage](#usage)\n - [Plain text](#plain-text)\n - [HTML Content](#html-content)\n - [Attachment](#attachment)\n- [Example](#example)\n\n\n## Installation\n\n```\npip install pysgs\n```\n\n## Setup\n\n```python\nimport pysgs\nservice = pysgs.mailer('SENDGRID_API_KEY')\n```\n\n### Headers\n\n```python\nsender = \"user@example.com\"\nrecipient = \"anotheruser@example.com\"\nsubject = \"This is a Subject!!\"\nservice.headers(sender, recipient, subject)\n```\n\n### Sender\n\nThere are different ways to set recipent emails.\n\n - user@example.com\n - user@example.com, anotheruser@example.com\n - User \n - User , Another User \n\nYou can also send a list of recipients\n\n```python\nrecipients = [\n \"User \",\n \"Another User \"\n]\n```\n\n## Usage\n\n### Plain text\n\n```python\nservice.content('Message from sendgrid')\nservice.send()\n```\n\n### HTML Content\n\n```python\nservice.content('

Hello World!

', 'html')\nservice.send()\n```\n\n### Attachment\n\n```python\nservice.content('/path/to/file/audio.mp3', is_attach=True)\nservice.send()\n```\n\n## Example\n\n```python\nimport pysgs\nfrom pysgs.exceptions import SGSError\n\ntry:\n \"\"\"Start connection\"\"\"\n service = pysgs.mailer(\"SENDGRID_API_KEY\")\n\n \"\"\"Set message headers\"\"\"\n sender = \"user@example.com\"\n recipient = \"anotheruser@example.com\"\n subject = \"This is a Subject!!\"\n service.headers(sender, recipient, subject)\n\n \"\"\"Set content\"\"\"\n service.content('Message from sendgrid')\n service.content('

Hello World!

', 'html')\n service.content('/path/to/file/audio.mp3', is_attach=True)\n\n \"\"\"Send message\"\"\"\n service.send()\n\n \"\"\"Finish service\"\"\"\n service.close()\n\nexcept SGSError as e:\n print('There was an error: ' + str(e))\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/estebansolo/pysgs", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pysgs", "package_url": "https://pypi.org/project/pysgs/", "platform": "", "project_url": "https://pypi.org/project/pysgs/", "project_urls": { "Homepage": "https://github.com/estebansolo/pysgs" }, "release_url": "https://pypi.org/project/pysgs/1.2/", "requires_dist": null, "requires_python": "", "summary": "Send messages through SendGrid using SMTP", "version": "1.2" }, "last_serial": 5392176, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "23618ce5e309992490343e19af131838", "sha256": "194ef7acd9d46f4d0ffd6aee0139ad3664b25af76d33f18755d79ec336003086" }, "downloads": -1, "filename": "pysgs-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "23618ce5e309992490343e19af131838", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4933, "upload_time": "2019-03-25T04:53:34", "url": "https://files.pythonhosted.org/packages/1d/3b/8ed4d1c964d71769a9eeb7fc3ed1146f3d3e9e77a1f910b83bcde4dd05b9/pysgs-0.1-py3-none-any.whl" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "94e14be268653460b9a2eda0a2097b88", "sha256": "04b063cd34a3aab816b92438debf600d1b8cd5031f999676506b2847250fbf96" }, "downloads": -1, "filename": "pysgs-1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "94e14be268653460b9a2eda0a2097b88", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4933, "upload_time": "2019-03-25T05:08:07", "url": "https://files.pythonhosted.org/packages/4d/f9/09c41de231da34c70d6f5fc35df2599acb74900cffb75799277a989b0627/pysgs-1.0-py3-none-any.whl" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "6699c6524064bf9b120f2d2ff2f226a7", "sha256": "b143f46c2c5d0eabf8aa29f46b443fb6c5d7e0af8ae081d091cdc7ebaacf8ca0" }, "downloads": -1, "filename": "pysgs-1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "6699c6524064bf9b120f2d2ff2f226a7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4933, "upload_time": "2019-03-25T05:22:15", "url": "https://files.pythonhosted.org/packages/35/be/2388d409dec7165c642cf64b3788fdd94fbf2b2b61ac0d144b95ee1b4874/pysgs-1.1-py3-none-any.whl" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "7f8b2c96f46ae834006563bc1f99e6f0", "sha256": "caf7ecd2f05cd2f40f34262cbc43f54285d3cb3d9b178bff4c5bfb2ae7ae09a5" }, "downloads": -1, "filename": "pysgs-1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "7f8b2c96f46ae834006563bc1f99e6f0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5587, "upload_time": "2019-06-12T17:33:49", "url": "https://files.pythonhosted.org/packages/0c/c3/dda7615504e710e0224bc8ef26697a6484dc177f44e5b4882cebb1059b5f/pysgs-1.2-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7f8b2c96f46ae834006563bc1f99e6f0", "sha256": "caf7ecd2f05cd2f40f34262cbc43f54285d3cb3d9b178bff4c5bfb2ae7ae09a5" }, "downloads": -1, "filename": "pysgs-1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "7f8b2c96f46ae834006563bc1f99e6f0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5587, "upload_time": "2019-06-12T17:33:49", "url": "https://files.pythonhosted.org/packages/0c/c3/dda7615504e710e0224bc8ef26697a6484dc177f44e5b4882cebb1059b5f/pysgs-1.2-py3-none-any.whl" } ] }