Skip to content

Commit

Permalink
correct upstream merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
codevbus committed Nov 4, 2017
2 parents 66749b8 + 4ae3c96 commit 36e68ba
Show file tree
Hide file tree
Showing 47 changed files with 2,289 additions and 1,199 deletions.
3 changes: 3 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins:
pep8:
enabled: true
1 change: 1 addition & 0 deletions .env_sample
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export SENDGRID_API_KEY=''
24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!--
We appreciate the effort for this pull request but before that please make sure you read the contribution guidelines given above, then fill out the blanks below.


Please enter each Issue number you are resolving in your PR after one of the following words [Fixes, Closes, Resolves]. This will auto-link these issues and close them when this PR is merged!
e.g.
Fixes #1
Closes #2
-->
# Fixes #

### Checklist
- [ ] I have made a material change to the repo (functionality, testing, spelling, grammar)
- [ ] I have read the [Contribution Guide] and my PR follows them.
- [ ] I updated my branch with the master branch.
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added necessary documentation about the functionality in the appropriate .md file
- [ ] I have added in line documentation to the code I modified

### Short description of what this PR does:
-
-

If you have questions, please send an email to [Sendgrid](mailto:[email protected]), or file a Github Issue in this repository.
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2012-2016 SendGrid, Inc.
Copyright (c) 2012-2017 SendGrid, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ echo "sendgrid.env" >> .gitignore
source ./sendgrid.env
```

Sendgrid also supports local enviroment file `.env`. Copy or rename `.env_sample` into `.env` and update [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys) with your key.

## Install Package

```bash
Expand Down Expand Up @@ -178,6 +180,8 @@ Please see [our helper](https://github.com/sendgrid/sendgrid-python/tree/master/
<a name="announcements"></a>
# Announcements

Join an experienced and passionate team that focuses on making an impact. Opportunities abound to grow the product - and grow your career! Check out our [Data Platform Engineer role](http://grnh.se/wbx1701)

Please see our announcement regarding [breaking changes](https://github.com/sendgrid/sendgrid-python/issues/217). Your support is appreciated!

All updates to this library are documented in our [CHANGELOG](https://github.com/sendgrid/sendgrid-python/blob/master/CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-python/releases). You may also subscribe to email [release notifications](https://dx.sendgrid.com/newsletter/java) for releases and breaking changes.
Expand Down
6 changes: 6 additions & 0 deletions TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ If you can't find a solution below, please open an [issue](https://github.com/se
* [Using the Package Manager](#package-manager)
* [Version Convention](#versions)
* [Viewing the Request Body](#request-body)
* [Error Handling](#error-handling)

<a name="environment"></a>
## Environment Variables and Your SendGrid API Key
Expand Down Expand Up @@ -106,3 +107,8 @@ You can do this right before you call `response = sg.client.mail.send.post(reque
```python
print mail.get()
```

<a name="error-handling"></a>
# Error Handling

Please review [our use_cases](https://github.com/sendgrid/sendgrid-python/USE_CASES.md) for examples of error handling.
15 changes: 7 additions & 8 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ print response.headers

**This endpoint allows you to retrieve all API Keys that belong to the authenticated user.**

The API Keys feature allows customers to be able to generate an API Key credential which can be used for authentication with the SendGrid v3 Web API or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).
The API Keys feature allows customers to generate an API Key credential which can be used for authentication with the SendGrid v3 Web API or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).

### GET /api_keys

Expand Down Expand Up @@ -389,7 +389,7 @@ print response.headers
```
## Retrieve an existing API Key

**This endpoint allows you to retrieve a single api key.**
**This endpoint allows you to retrieve a single API key.**

If the API Key ID does not exist an HTTP 404 will be returned.

Expand Down Expand Up @@ -3020,7 +3020,7 @@ print response.headers
```
## Delete a subuser

This endpoint allows you to delete a subuser. This is a permanent action, once deleted a subuser cannot be retrieved.
This endpoint allows you to delete a subuser. This is a permanent action, once you delete a subuser it cannot be retrieved.

For more information about Subusers:

Expand Down Expand Up @@ -3308,7 +3308,7 @@ print response.headers

**This endpoint allows you to remove an email address from your bounce list.**

Bounces are messages that are returned to the server that sent it. This endpoint allows you to delete a single email addresses from your bounce list.
Bounces are messages that are returned to the server that sent it. This endpoint allows you to delete a single email address from your bounce list.

For more information see:

Expand Down Expand Up @@ -4523,7 +4523,7 @@ print response.headers

A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record.

Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The the parent may then associate the whitelabel via the subuser management tools.
Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The parent may then associate the whitelabel via the subuser management tools.

For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)

Expand All @@ -4547,7 +4547,7 @@ print response.headers

A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record.

Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The the parent may then associate the whitelabel via the subuser management tools.
Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The parent may then associate the whitelabel via the subuser management tools.

For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)

Expand Down Expand Up @@ -4630,7 +4630,7 @@ print response.headers

A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record.

Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The the parent may then associate the whitelabel via the subuser management tools.
Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The parent may then associate the whitelabel via the subuser management tools.

For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)

Expand Down Expand Up @@ -5034,4 +5034,3 @@ print response.status_code
print response.body
print response.headers
```

30 changes: 30 additions & 0 deletions USE_CASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This documentation provides examples for specific use cases. Please [open an iss
* [How to Setup a Domain Whitelabel](#domain_whitelabel)
* [How to View Email Statistics](#email_stats)
* [Asynchronous Mail Send](#asynchronous-mail-send)
* [Error Handling](#error-handling)
* [Deploy A Simple Hello Email App on AWS](#hello_email_on_aws)

<a name="transactional-templates"></a>
Expand Down Expand Up @@ -272,6 +273,35 @@ if __name__ == "__main__":
task = asyncio.async(send_many(ems, sample_cb))
loop.run_until_complete(task)
```

<a name="error-handling"></a>
# Error Handling
[Custom exceptions](https://github.com/sendgrid/python-http-client/blob/master/python_http_client/exceptions.py) for `python_http_client` are now supported, which can be imported by consuming libraries.

Please see [here](https://github.com/sendgrid/python-http-client/blob/master/python_http_client/exceptions.py) for a list of supported exceptions.

```python
import sendgrid
import os
from sendgrid.helpers.mail import *
from python_http_client import exceptions

sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
from_email = Email("[email protected]")
to_email = Email("[email protected]")
subject = "Sending with SendGrid is Fun"
content = Content("text/plain", "and easy to do anywhere, even with Python")
mail = Mail(from_email, subject, to_email, content)
try:
response = sg.client.mail.send.post(request_body=mail.get())
except exceptions.BadRequestsError as e:
print(e.body)
exit()
print(response.status_code)
print(response.body)
print(response.headers)
```

<a name="hello_email_on_aws"></a>
# Deploy a simple Hello Email app on AWS

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ WORKDIR /root

# install Prism
ADD https://raw.githubusercontent.com/stoplightio/prism/master/install.sh install.sh
RUN chmod +x ./install.sh && \
RUN chmod +x ./install.sh && sync && \
./install.sh && \
rm ./install.sh

Expand Down
Loading

0 comments on commit 36e68ba

Please sign in to comment.