Skip to content

Commit e3ed255

Browse files
Fix examples, docs and readme example code
1 parent 9f5ac66 commit e3ed255

File tree

9 files changed

+418
-341
lines changed

9 files changed

+418
-341
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ easy_install sendgrid
5959

6060
```python
6161
import sendgrid
62+
import os
6263
from sendgrid.helpers.mail import *
6364

65+
sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
6466
from_email = Email("[email protected]")
6567
subject = "Hello World from the SendGrid Python Library"
6668
to_email = Email("[email protected]")
@@ -76,8 +78,9 @@ print(response.headers)
7678

7779
```python
7880
import sendgrid
81+
import os
7982

80-
sg = sendgrid.SendGridAPIClient()
83+
sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
8184
response = sg.client.api_keys.get()
8285
print(response.status_code)
8386
print(response.body)

0 commit comments

Comments
 (0)