From 4989961cc2a9e71b63a847f04048ef54da31794d Mon Sep 17 00:00:00 2001 From: Elmer Thomas Date: Wed, 13 Jul 2016 16:37:45 -0700 Subject: [PATCH 1/4] Adding troubleshooting section --- README.md | 10 ++++----- TROUBLESHOOTING.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 TROUBLESHOOTING.md diff --git a/README.md b/README.md index 26504b952..a06bedecd 100644 --- a/README.md +++ b/README.md @@ -43,12 +43,6 @@ source ./sendgrid.env pip install sendgrid ``` -or - -```bash -easy_install sendgrid -``` - ## Dependencies - The SendGrid Service, starting at the [free level](https://sendgrid.com/free?source=sendgrid-python)) @@ -110,6 +104,10 @@ Quick links: - [Sign the CLA to Create a Pull Request](https://github.com/sendgrid/sendgrid-open-source-templates/tree/master/CONTRIBUTING.md#cla) - [Improvements to the Codebase](https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#improvements_to_the_codebase) +# Troubleshooting + +Please see our [troubleshooting guide](https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md) for common library issues. + # About sendgrid-python is guided and supported by the SendGrid [Developer Experience Team](mailto:dx@sendgrid.com). diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md new file mode 100644 index 000000000..1c395fdbd --- /dev/null +++ b/TROUBLESHOOTING.md @@ -0,0 +1,52 @@ +If you have a non-library SendGrid issue, please contact our [support team](https://support.sendgrid.com). + +If you can't find a solution below, please open an [issue](https://github.com/sendgrid/sendgrid-python/issues). + +## Migrating from v2 to v3 + +Please review [our guide](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/how_to_migrate_from_v2_to_v3_mail_send.html) on how to migrate from v2 to v3. + +## Testing v3 /mail/send calls directly + +[Here](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/curl_examples.html) are some cURL examples for common use cases. + +## Error Messages + +To read the error message returned by SendGrid's API: + +```python +try: + response = sg.client.mail.send.post(request_body=mail.get()) +except urllib2.HTTPError as e: + print e.read() +``` + +## Versions + +We follow the MAJOR.MINOR.PATCH versioning scheme as described by [SemVer.org](http://semver.org). Therefore, we recommend that you always pin (or vendor) the particular version you are working with to your code and never auto-update to the latest version. Especially when there is a MAJOR point release, since that is guarenteed to be a breaking change. + +## Environment Variables and your SendGrid API Key + +All of our examples assume you are using [environment variables](https://github.com/sendgrid/sendgrid-python#setup-environment-variables) to hold your SendGrid API key. + +If you choose to add your SendGrid API key directly (not recommended): + +`apikey=os.environ.get('SENDGRID_API_KEY')` + +becomes + +`apikey='SENDGRID_API_KEY'` + +In the first case SENDGRID_API_KEY is in reference to the name of the environment variable, while the second case references the actual SendGrid API Key. + +## Using the Package Manager + +We upload this library to [PyPI](https://pypi.python.org/pypi/sendgrid) whenever we make a release. This allows you to use [pip](https://pypi.python.org/pypi/pip) for easy installation. + +In most cases we recommend you download the latest version of the library, but if you need a different version, please use: + +`pip install sendgrid==X.X.X` + +If you are usring a [requirements file](https://pip.readthedocs.io/en/1.1/requirements.html), please use: + +`sendgrid==X.X.X` \ No newline at end of file From be14d007a812ec5f630af35ec69916f72575f19b Mon Sep 17 00:00:00 2001 From: Elmer Thomas Date: Mon, 25 Jul 2016 13:33:24 -0700 Subject: [PATCH 2/4] Added v2 section and table of contents --- TROUBLESHOOTING.md | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index 1c395fdbd..3d74455b5 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -2,14 +2,44 @@ If you have a non-library SendGrid issue, please contact our [support team](http If you can't find a solution below, please open an [issue](https://github.com/sendgrid/sendgrid-python/issues). + +# Table of Contents + +* [Migrating from v2 to v3](#migrating) +* [Continue Using v2](#v2) +* [Testing v3 /mail/send Calls Directly](#testing) +* [Error Messages](#error) +* [Versions](#versions) +* [Environment Variables and Your SendGrid API Key](#environment) +* [Using the Package Manager](#package-manager) + + ## Migrating from v2 to v3 Please review [our guide](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/how_to_migrate_from_v2_to_v3_mail_send.html) on how to migrate from v2 to v3. -## Testing v3 /mail/send calls directly + +## Continue Using v2 + +[Here](https://github.com/sendgrid/sendgrid-python/tree/0942f9de2d5ba5fedb65a23940ebe1005a21a6c7) is the last working version with v2 support. + +Using pip: + +```bash +pip unistall sendgrid +pip install sendgrid=1.6.22 +``` + +Download: + +Click the "Clone or download" green button in [GitHub](https://github.com/sendgrid/sendgrid-python/tree/0942f9de2d5ba5fedb65a23940ebe1005a21a6c7) and choose download. + + +## Testing v3 /mail/send Calls Directly [Here](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/curl_examples.html) are some cURL examples for common use cases. + ## Error Messages To read the error message returned by SendGrid's API: @@ -21,11 +51,13 @@ except urllib2.HTTPError as e: print e.read() ``` + ## Versions We follow the MAJOR.MINOR.PATCH versioning scheme as described by [SemVer.org](http://semver.org). Therefore, we recommend that you always pin (or vendor) the particular version you are working with to your code and never auto-update to the latest version. Especially when there is a MAJOR point release, since that is guarenteed to be a breaking change. -## Environment Variables and your SendGrid API Key + +## Environment Variables and Your SendGrid API Key All of our examples assume you are using [environment variables](https://github.com/sendgrid/sendgrid-python#setup-environment-variables) to hold your SendGrid API key. @@ -39,6 +71,7 @@ becomes In the first case SENDGRID_API_KEY is in reference to the name of the environment variable, while the second case references the actual SendGrid API Key. + ## Using the Package Manager We upload this library to [PyPI](https://pypi.python.org/pypi/sendgrid) whenever we make a release. This allows you to use [pip](https://pypi.python.org/pypi/pip) for easy installation. From 1c04fa79f2ea67ea25285b9fe673b506e55457b0 Mon Sep 17 00:00:00 2001 From: Elmer Thomas Date: Mon, 25 Jul 2016 13:37:19 -0700 Subject: [PATCH 3/4] Minor formatting change --- TROUBLESHOOTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index 3d74455b5..4cdaa8e0f 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -3,7 +3,7 @@ If you have a non-library SendGrid issue, please contact our [support team](http If you can't find a solution below, please open an [issue](https://github.com/sendgrid/sendgrid-python/issues). -# Table of Contents +## Table of Contents * [Migrating from v2 to v3](#migrating) * [Continue Using v2](#v2) From 652f7a9fecf58013c546d3859a7f63c7e58ac994 Mon Sep 17 00:00:00 2001 From: Elmer Thomas Date: Mon, 25 Jul 2016 14:00:58 -0700 Subject: [PATCH 4/4] Final changes before merge --- TROUBLESHOOTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index 4cdaa8e0f..ce2838d90 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -26,7 +26,7 @@ Please review [our guide](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/ Using pip: ```bash -pip unistall sendgrid +pip uninstall sendgrid pip install sendgrid=1.6.22 ``` @@ -54,7 +54,7 @@ except urllib2.HTTPError as e: ## Versions -We follow the MAJOR.MINOR.PATCH versioning scheme as described by [SemVer.org](http://semver.org). Therefore, we recommend that you always pin (or vendor) the particular version you are working with to your code and never auto-update to the latest version. Especially when there is a MAJOR point release, since that is guarenteed to be a breaking change. +We follow the MAJOR.MINOR.PATCH versioning scheme as described by [SemVer.org](http://semver.org). Therefore, we recommend that you always pin (or vendor) the particular version you are working with to your code and never auto-update to the latest version. Especially when there is a MAJOR point release, since that is guarenteed to be a breaking change. Changes are documented in the [CHANGELOG](https://github.com/sendgrid/sendgrid-python/blob/master/CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-python/releases) section. ## Environment Variables and Your SendGrid API Key