Skip to content

Commit b4f5738

Browse files
Version Bump v2.0.1
1 parent ceaff3f commit b4f5738

File tree

28 files changed

+222
-64
lines changed

28 files changed

+222
-64
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4+
## [2.1.0] - 2016-03-02 ##
5+
6+
### Added ###
7+
8+
- you can now pass an apikey to the SendGridAPIClient, per issue [#168](https://github.com/sendgrid/sendgrid-python/issues/168). Thanks [Matt](https://github.com/mbernier)!
9+
410
## [2.0.0] - 2016-03-01 ##
511

612
### Added ###

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ or
1818
- [SMTAPI-Python](https://github.com/sendgrid/smtpapi-python)
1919
- [Python-HTTP-Client](https://github.com/sendgrid/python-http-client)
2020

21-
## Environment Variables
21+
## Environment Variables (for v3 Web API)
2222

23-
[Sample .env](https://github.com/sendgrid/sendgrid-python/blob/python_http_client/.env_sample), please rename to `.env` and add your [SendGrid API Key](https://app.sendgrid.com/settings/api_keys).
23+
[Sample .env](https://github.com/sendgrid/sendgrid-python/blob/python_http_client/.env_sample), please rename to `.env` and add your [SendGrid API Key](https://app.sendgrid.com/settings/api_keys), or you can pass your API Key into the SendGridClient constructor.
2424

2525
# Quick Start
2626

@@ -31,6 +31,7 @@ import sendgrid
3131

3232
sg = sendgrid.SendGridClient('YOUR_SENDGRID_API_KEY')
3333

34+
3435
message = sendgrid.Mail()
3536
message.add_to('John Doe <john@email.com>')
3637
message.set_subject('Example')
@@ -52,7 +53,8 @@ print(status, msg)
5253
```python
5354
import sendgrid
5455

55-
sg = sendgrid.SendGridAPIClient()
56+
sg = sendgrid.SendGridAPIClient(apikey='YOUR_SENDGRID_API_KEY')
57+
# You can also store your API key an .env variable 'SENDGRID_API_KEY'
5658

5759
response = sg.client.api_keys.get()
5860
print(response.status_code)

USAGE.md

Lines changed: 149 additions & 22 deletions
Large diffs are not rendered by default.

examples/apikey/apikey.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import json
33
import os
44

5-
sg = sendgrid.SendGridAPIClient()
5+
sg = sendgrid.SendGridAPIClient(apikey='YOUR_SENDGRID_API_KEY')
6+
# You can also store your API key an .env variable 'SENDGRID_API_KEY'
67

78
##################################################
89
# Create API keys #

examples/apikeys/apikeys.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import json
33
import os
44

5-
sg = sendgrid.SendGridAPIClient()
5+
sg = sendgrid.SendGridAPIClient(apikey='YOUR_SENDGRID_API_KEY')
6+
# You can also store your API key an .env variable 'SENDGRID_API_KEY'
67

78
##################################################
89
# List all API Keys belonging to the authenticated user #

examples/asm/asm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import json
33
import os
44

5-
sg = sendgrid.SendGridAPIClient()
5+
sg = sendgrid.SendGridAPIClient(apikey='YOUR_SENDGRID_API_KEY')
6+
# You can also store your API key an .env variable 'SENDGRID_API_KEY'
67

78
##################################################
89
# Create a Group #

examples/browsers/browsers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import json
33
import os
44

5-
sg = sendgrid.SendGridAPIClient()
5+
sg = sendgrid.SendGridAPIClient(apikey='YOUR_SENDGRID_API_KEY')
6+
# You can also store your API key an .env variable 'SENDGRID_API_KEY'
67

78
##################################################
89
# Retrieve email statistics by browser. #

examples/campaigns/campaigns.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import json
33
import os
44

5-
sg = sendgrid.SendGridAPIClient()
5+
sg = sendgrid.SendGridAPIClient(apikey='YOUR_SENDGRID_API_KEY')
6+
# You can also store your API key an .env variable 'SENDGRID_API_KEY'
67

78
##################################################
89
# Create a Campaign #

examples/categories/categories.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import json
33
import os
44

5-
sg = sendgrid.SendGridAPIClient()
5+
sg = sendgrid.SendGridAPIClient(apikey='YOUR_SENDGRID_API_KEY')
6+
# You can also store your API key an .env variable 'SENDGRID_API_KEY'
67

78
##################################################
89
# Get categories #

examples/clients/clients.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import json
33
import os
44

5-
sg = sendgrid.SendGridAPIClient()
5+
sg = sendgrid.SendGridAPIClient(apikey='YOUR_SENDGRID_API_KEY')
6+
# You can also store your API key an .env variable 'SENDGRID_API_KEY'
67

78
##################################################
89
# Retrieve email statistics by client type. #

0 commit comments

Comments
 (0)