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
<?php | |
require 'vendor/autoload.php'; | |
require 'lib/SendGrid.php'; | |
require 'lib/Client.php'; | |
Dotenv::load(__DIR__); | |
$sendgrid_apikey = getenv('SG_KEY'); | |
$sendgrid = new Client($sendgrid_apikey); | |
$response = $sendgrid->asm_groups->get(); |
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
<?php | |
require 'vendor/autoload.php'; | |
Dotenv::load(__DIR__); | |
$sendgrid_apikey = getenv('SG_KEY'); | |
$sendgrid = new Client($sendgrid_apikey); | |
$group_id = 70 | |
$response = $sendgrid->asm_suppressions->get($group_id); | |
print("Status Code: " . $response->getStatusCode() . "\n"); | |
print("Body: " . $response->getBody() . "\n"); |
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
<?php | |
require 'vendor/autoload.php'; | |
Dotenv::load(__DIR__); | |
$sendgrid_apikey = getenv('SG_KEY'); | |
$sendgrid = new Client($sendgrid_apikey); | |
$group_id = 70; | |
$email = 'elmer.thomas+test1@gmail.com'; | |
$response = $sendgrid->asm_suppressions->post($group_id, $email); | |
print("Status Code: " . $response->getStatusCode() . "\n"); |
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
<?php | |
require 'vendor/autoload.php'; | |
Dotenv::load(__DIR__); | |
$sendgrid_apikey = getenv('SG_KEY'); | |
$sendgrid = new Client($sendgrid_apikey); | |
$group_id = 70; | |
$email = 'elmer.thomas+test1@gmail.com'; | |
$response = $sendgrid->asm_suppressions->delete($group_id, $email); | |
print("Status Code: " . $response->getStatusCode() . "\n"); | |
print("Body: " . $response->getBody() . "\n"); |
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
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] |
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
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] |
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
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] |
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
import sendgrid | |
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')) | |
name = "My Amazing API Key" |
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
import sendgrid | |
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')) | |
status, msg = client.apikeys.delete(api_key_id) |
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
import sendgrid | |
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')) | |
name = "My NEW API Key 3000" |