Created
October 14, 2015 16:12
-
-
Save thinkingserious/1baf67106a27eba9baf1 to your computer and use it in GitHub Desktop.
SendGrid Python v3 ASM Global Suppressions Example
This file contains hidden or 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
import sendgrid | |
import json | |
import os | |
if os.path.exists('.env'): | |
for line in open('.env'): | |
var = line.strip().split('=') | |
if len(var) == 2: | |
os.environ[var[0]] = var[1] | |
client = sendgrid.SendGridAPIClient(os.environ.get('SENDGRID_API_KEY')) | |
# In the global suppression list | |
status, msg = client.asm_global_suppressions.get('[email protected]') | |
print status | |
print msg | |
# Not in the global suppression list | |
status, msg = client.asm_global_suppressions.get('[email protected]') | |
print status | |
print msg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment