-
Notifications
You must be signed in to change notification settings - Fork 714
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #146 from sendgrid/api_keys_v3
Added api_keys POST, PATCH, DELETE
- Loading branch information
Showing
5 changed files
with
40 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,12 +9,14 @@ | |
sg = sendgrid.SendGridClient(os.environ.get('SENDGRID_USERNAME'), os.environ.get('SENDGRID_PASSWORD')) | ||
|
||
""" | ||
to = 'Jane Doe <[email protected]>' | ||
from = 'John Doe <[email protected]>' | ||
message = sendgrid.Mail() | ||
message.add_to('Elmer Thomas <[email protected]>') | ||
message.add_to(to) | ||
message.set_subject('Testing from the Python library') | ||
message.set_html('<b>This was a successful test!</b>') | ||
message.set_text('This was a successful test!') | ||
message.set_from('Elmer Thomas <[email protected]>') | ||
message.set_from(from) | ||
status, msg = sg.send(message) | ||
print status | ||
print msg | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,7 @@ | |
client = sendgrid.SendGridAPIClient(os.environ.get('SENDGRID_API_KEY')) | ||
|
||
""" | ||
email = '[email protected]' | ||
email = '[email protected]' | ||
status, msg = client.asm_global_suppressions.delete(email) | ||
print status | ||
print msg | ||
|
@@ -21,7 +20,7 @@ | |
print status | ||
print msg | ||
status, msg = client.asm_global_suppressions.post(['elmer.thomas+test_global0@gmail.com']) | ||
status, msg = client.asm_global_suppressions.post(['example@example.com']) | ||
print status | ||
print msg | ||
|
@@ -47,24 +46,24 @@ | |
print msg | ||
# In the global suppression list | ||
status, msg = client.asm_global_suppressions.get('elmer.thomas+test_global@gmail.com') | ||
status, msg = client.asm_global_suppressions.get('example@example.com') | ||
print status | ||
print msg | ||
# Not in the global suppression list | ||
status, msg = client.asm_global_suppressions.get('elmer.thomas@gmail.com') | ||
status, msg = client.asm_global_suppressions.get('example@example.com') | ||
print status | ||
print msg | ||
status, msg = client.apikeys.get() | ||
print status | ||
print msg | ||
status, msg = client.asm_suppressions.delete(67,'elmer+test@thinkingserious.com') | ||
status, msg = client.asm_suppressions.delete(67,'example@example.com') | ||
print status | ||
print msg | ||
status, msg = client.asm_suppressions.post(60, ['elmer+test@thinkingserious.com', 'elmer.thomas@yahoo.com']) | ||
status, msg = client.asm_suppressions.post(60, ['example@example.com', 'example@example.com]) | ||
print status | ||
print msg | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
version_info = (1, 5, 14) | ||
version_info = (1, 5, 15) | ||
__version__ = '.'.join(str(v) for v in version_info) |