{ "info": { "author": "Paubox", "author_email": "info@paubox.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 2.7" ], "description": "\"Paubox\"\r\n\r\n# Paubox Python Package\r\n\r\nThis package and Paubox Transactional Email HTTP API are currently in alpha development.\r\n\r\nThis is the official Python package for the Paubox Transactional Email HTTP API. The Paubox Transactional Email API allows your application to send secure, HIPAA-compliant email via Paubox and track deliveries and opens.\r\n\r\n# Table of Contents\r\n* [Installation](#installation)\r\n* [Usage](#usage)\r\n* [Contributing](#contributing)\r\n* [License](#license)\r\n\r\n\r\n## Installation\r\n\r\n### Getting Paubox API Credentials\r\nYou will need to have a Paubox account. You can [sign up here](https://www.paubox.com/join/see-pricing?unit=messages).\r\n\r\nOnce you have an account, follow the instructions on the Rest API dashboard to verify domain ownership and generate API credentials.\r\n\r\n### Setup Environment Variables\r\n\r\n```\r\n$ echo \"export PAUBOX_API_KEY='YOUR_API_KEY'\" > .env\r\n$ echo \"export PAUBOX_HOST='https://api.paubox.net/v1/YOUR_ENDPOINT_NAME'\" >> .env\r\n$ echo \".env\" >> .gitignore\r\n$ source .env\r\n```\r\n\r\n### Install Package\r\n```\r\n$ pip install paubox-python\r\n```\r\n\r\n### Dependencies\r\n[Requests](https://github.com/requests/requests)\r\n\r\n\r\n## Usage\r\n\r\n### Sending Messages with the Paubox Mail Helper\r\n\r\nSending via Paubox is easy. This is the minimum content needed to send an email.\r\n```python\r\nimport paubox\r\nfrom paubox.helpers.mail import Mail\r\n\r\npaubox_client = paubox.PauboxApiClient()\r\nrecipients = [\"recipient@example.com\"]\r\nfrom_ = \"sender@yourdomain.com\"\r\nsubject = \"Testing!\"\r\ncontent = {\"text/plain\": \"Hello World!\"}\r\nmail = Mail(from_, subject, recipients, content)\r\nresponse = paubox_client.send(mail.get())\r\nprint(response.status_code)\r\nprint(response.headers)\r\nprint(response.text)\r\n```\r\n\r\n### Sending Messages without the Mail Helper Class\r\n```python\r\nimport paubox\r\n\r\npaubox_client = paubox.PauboxApiClient()\r\nmail = {\r\n \"data\": {\r\n \"message\": {\r\n \"recipients\": [\r\n \"recipient@example.com\"\r\n ],\r\n \"headers\": {\r\n \"subject\": \"Testing!\",\r\n \"from\": \"sender@yourdomain.com\"\r\n },\r\n \"content\": {\r\n \"text/plain\": \"Hello World!\",\r\n }\r\n }\r\n }\r\n}\r\nresponse = paubox_client.send(mail)\r\nprint(response.status_code)\r\nprint(response.headers)\r\nprint(response.text)\r\n```\r\n\r\n### Allowing non-TLS message delivery\r\n\r\nIf you want to send non-PHI mail that does not need to be HIPAA-compliant, you can allow the message delivery to take place even if a TLS connection is unavailable.\r\n\r\nThis means the message will not be converted into a secure portal message when a nonTLS connection is encountered. For this, just pass allowNonTLS as True, as shown below:\r\n\r\n#### Using Mail Class Helper\r\n```python\r\nimport paubox\r\nfrom paubox.helpers.mail import Mail\r\n\r\npaubox_client = paubox.PauboxApiClient()\r\nrecipients = [\"recipient@example.com\"]\r\nfrom_ = \"sender@yourdomain.com\"\r\nsubject = \"Testing!\"\r\ncontent = {\r\n \"text/plain\": \"Hello World!\" \r\n}\r\noptional_headers = { \r\n 'reply_to': 'replies@yourdomain.com', \r\n 'allowNonTLS': True\r\n}\r\nmail = Mail(from_, subject, recipients, content, optional_headers)\r\nresponse = paubox_client.send(mail.get())\r\nprint(response.status_code)\r\nprint(response.headers)\r\nprint(response.text)\r\n```\r\n\r\n#### Without the Mail Class Helper\r\n```python\r\nimport paubox\r\n\r\npaubox_client = paubox.PauboxApiClient()\r\nmail = {\r\n \"data\": {\r\n \"message\": {\r\n \"recipients\": [\r\n \"recipient@example.com\"\r\n ], \r\n 'allowNonTLS': True,\r\n \"headers\": {\r\n \"subject\": \"Testing!\",\r\n \"from\": \"Sender \",\r\n \"reply-to\": \"Reply-to \"\r\n },\r\n \"content\": {\r\n \"text/plain\": \"Hello World!\", \r\n } \r\n }\r\n }\r\n}\r\nresponse = paubox_client.send(mail)\r\nprint(response.status_code)\r\nprint(response.headers)\r\nprint(response.text)\r\n```\r\n\r\n### Forcing Secure Notifications\r\n\r\nPaubox Secure Notifications allow an extra layer of security, especially when coupled with an organization's requirement for message recipients to use 2-factor authentication to read messages (this setting is available to org administrators in the Paubox Admin Panel).\r\n\r\nInstead of receiving an email with the message contents, the recipient will receive a notification email that they have a new message in Paubox.\r\n\r\n#### Using Mail Class Helper\r\n```python\r\nimport paubox\r\nfrom paubox.helpers.mail import Mail\r\n\r\npaubox_client = paubox.PauboxApiClient()\r\nrecipients = [\"recipient@example.com\"]\r\nfrom_ = \"sender@yourdomain.com\"\r\nsubject = \"Testing!\"\r\ncontent = {\r\n \"text/plain\": \"Hello World!\" \r\n}\r\noptional_headers = { \r\n 'reply_to': 'replies@yourdomain.com', \r\n 'forceSecureNotification': 'true'\r\n}\r\nmail = Mail(from_, subject, recipients, content, optional_headers)\r\nresponse = paubox_client.send(mail.get())\r\nprint(response.status_code)\r\nprint(response.headers)\r\nprint(response.text)\r\n```\r\n\r\n#### Without the Mail Class Helper\r\n```python\r\nimport paubox\r\n\r\npaubox_client = paubox.PauboxApiClient()\r\nmail = {\r\n \"data\": {\r\n \"message\": {\r\n \"recipients\": [\r\n \"recipient@example.com\"\r\n ], \r\n 'forceSecureNotification': 'true',\r\n \"headers\": {\r\n \"subject\": \"Testing!\",\r\n \"from\": \"Sender \",\r\n \"reply-to\": \"Reply-to \"\r\n },\r\n \"content\": {\r\n \"text/plain\": \"Hello World!\" \r\n } \r\n }\r\n }\r\n}\r\nresponse = paubox_client.send(mail)\r\nprint(response.status_code)\r\nprint(response.headers)\r\nprint(response.text)\r\n```\r\n\r\n### Sending Messages with all available headers\r\n\r\n#### Using Mail Class Helper\r\n```python\r\nimport paubox\r\nimport base64\r\nfrom paubox.helpers.mail import Mail\r\n\r\npaubox_client = paubox.PauboxApiClient()\r\nrecipients = [\"recipient@example.com\"]\r\nfrom_ = \"sender@yourdomain.com\"\r\nsubject = \"Testing!\"\r\nattachment_content = base64.b64encode(\"Hello World!\")\r\ncontent = {\r\n \"text/plain\": \"Hello World!\",\r\n \"text/html\": \"

Hello World!

\"\r\n}\r\noptional_headers = {\r\n \"attachments\": [{\r\n \"fileName\": \"the_file.txt\",\r\n \"contentType\": \"text/plain\",\r\n \"content\": attachment_content\r\n }],\r\n 'reply_to': 'replies@yourdomain.com',\r\n 'bcc': 'recipient2@example.com',\r\n 'cc':['recipientcc@example.com'],\r\n 'forceSecureNotification': 'true',\r\n 'allowNonTLS': True\r\n}\r\nmail = Mail(from_, subject, recipients, content, optional_headers)\r\nresponse = paubox_client.send(mail.get())\r\nprint(response.status_code)\r\nprint(response.headers)\r\nprint(response.text)\r\n```\r\n\r\n#### Without the Mail Class Helper\r\n```python\r\nimport paubox\r\nimport base64\r\n\r\npaubox_client = paubox.PauboxApiClient()\r\nattachment_content = base64.b64encode(\"Hello World!\")\r\nmail = {\r\n \"data\": {\r\n \"message\": {\r\n \"recipients\": [\r\n \"recipient@example.com\"\r\n ],\r\n \"bcc\": [\"recipient2@example.com\"],\r\n 'cc':['recipientcc@example.com'],\r\n 'forceSecureNotification':'true',\r\n 'allowNonTLS': True,\r\n \"headers\": {\r\n \"subject\": \"Testing!\",\r\n \"from\": \"Sender \",\r\n \"reply-to\": \"Reply-to \"\r\n },\r\n \"content\": {\r\n \"text/plain\": \"Hello World!\",\r\n \"text/html\": \"

Hello World!

\"\r\n },\r\n \"attachments\": [{\r\n \"fileName\": \"the_file.txt\",\r\n \"contentType\": \"text/plain\",\r\n \"content\": attachment_content\r\n }]\r\n }\r\n }\r\n}\r\nresponse = paubox_client.send(mail)\r\nprint(response.status_code)\r\nprint(response.headers)\r\nprint(response.text)\r\n```\r\n\r\n\r\n### Checking Email Dispositions\r\nThe SOURCE_TRACKING_ID of a message is returned in the response.text of your send request. Use response.to_dict to access the response text as a dictionary.\r\n```python\r\nimport paubox\r\n\r\npaubox_client = paubox.PauboxApiClient()\r\ndisposition_response = paubox_client.get(\"SOURCE_TRACKING_ID\")\r\nprint(disposition_response.status_code)\r\nprint(disposition_response.headers)\r\nprint(disposition_response.text)\r\n```\r\n\r\n\r\n## Contributing\r\n\r\nBug reports and pull requests are welcome on GitHub at https://github.com/Paubox/paubox-python.\r\n\r\n\r\n## License\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n\r\n## Copyright\r\nCopyright © 2019, Paubox Inc.\r\n\r\n\r\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/Paubox/paubox-python", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "paubox-python", "package_url": "https://pypi.org/project/paubox-python/", "platform": "", "project_url": "https://pypi.org/project/paubox-python/", "project_urls": { "Homepage": "https://github.com/Paubox/paubox-python" }, "release_url": "https://pypi.org/project/paubox-python/0.0.3/", "requires_dist": null, "requires_python": "", "summary": "Python SDK for Paubox Email REST API", "version": "0.0.3" }, "last_serial": 5476042, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "e75bb6c2c9e96c8aa058ef8395c2eb85", "sha256": "5b6b37549cab1e9b8c6fc9c5967b16024040ab3ce21c1f97db5f2a43654bc311" }, "downloads": -1, "filename": "paubox_python-0.0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "e75bb6c2c9e96c8aa058ef8395c2eb85", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 6842, "upload_time": "2018-07-31T21:43:28", "url": "https://files.pythonhosted.org/packages/66/9e/0bdc479b61281811937b9194b0d673735e1903cbd6772e38134b4d4f5a1c/paubox_python-0.0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a52e1deee91cdad55faa3cea96f68372", "sha256": "31f1fb7730a71a2d9a5d1a16551ee5e751647f5077b32dada413792178ece039" }, "downloads": -1, "filename": "paubox-python-0.0.2.tar.gz", "has_sig": false, "md5_digest": "a52e1deee91cdad55faa3cea96f68372", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5227, "upload_time": "2018-07-31T21:43:29", "url": "https://files.pythonhosted.org/packages/ea/37/93e77c2e4761436aeac9f987b4eda1ea10be3876a8b0d25f8ba22eaaaa32/paubox-python-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "033f1142a35fc840e9dcec28d03d861e", "sha256": "1211e1d314d1c771623cfbebff3ce64d31381d9ee9052413b8772b169f7f5252" }, "downloads": -1, "filename": "paubox_python-0.0.3-py2-none-any.whl", "has_sig": false, "md5_digest": "033f1142a35fc840e9dcec28d03d861e", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 12326, "upload_time": "2019-07-02T09:27:50", "url": "https://files.pythonhosted.org/packages/e0/70/03f98af50cb1fba1030a1e43f071d5234f07cf01c9d402a38673be1a34ba/paubox_python-0.0.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a1a5e25895f70ff780116d781299e238", "sha256": "46ba9b2dcb4229417a723c7a02804a8e0a911d92de20d2f163e276c18b3d2e3f" }, "downloads": -1, "filename": "paubox-python-0.0.3.tar.gz", "has_sig": false, "md5_digest": "a1a5e25895f70ff780116d781299e238", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6747, "upload_time": "2019-07-02T09:27:52", "url": "https://files.pythonhosted.org/packages/da/bf/64ac83b35c9e7048559b4e82045120685b99022acf3b6b3f067d0132e1d1/paubox-python-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "033f1142a35fc840e9dcec28d03d861e", "sha256": "1211e1d314d1c771623cfbebff3ce64d31381d9ee9052413b8772b169f7f5252" }, "downloads": -1, "filename": "paubox_python-0.0.3-py2-none-any.whl", "has_sig": false, "md5_digest": "033f1142a35fc840e9dcec28d03d861e", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 12326, "upload_time": "2019-07-02T09:27:50", "url": "https://files.pythonhosted.org/packages/e0/70/03f98af50cb1fba1030a1e43f071d5234f07cf01c9d402a38673be1a34ba/paubox_python-0.0.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a1a5e25895f70ff780116d781299e238", "sha256": "46ba9b2dcb4229417a723c7a02804a8e0a911d92de20d2f163e276c18b3d2e3f" }, "downloads": -1, "filename": "paubox-python-0.0.3.tar.gz", "has_sig": false, "md5_digest": "a1a5e25895f70ff780116d781299e238", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6747, "upload_time": "2019-07-02T09:27:52", "url": "https://files.pythonhosted.org/packages/da/bf/64ac83b35c9e7048559b4e82045120685b99022acf3b6b3f067d0132e1d1/paubox-python-0.0.3.tar.gz" } ] }