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
<?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
<?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 | |
$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'; | |
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
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.asm_groups.post("Magic Key", "Unlock your Emails") |
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
<?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->api_keys->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
var myMessage = new SendGridMessage(); | |
myMessage.From = new MailAddress("elmer@thinkingserious.com"); | |
myMessage.AddTo("elmer.thomas@sendgrid.com"); | |
myMessage.Subject = "Testing the SendGrid Library"; | |
myMessage.Text = "Hello World"; | |
var sg_username = Environment.GetEnvironmentVariable("SENDGRID_USERNAME"); | |
var sg_password = Environment.GetEnvironmentVariable("SENDGRID_PASSWORD"); | |
var credentials = new NetworkCredential(sg_username, sg_password); | |
var transportWeb = new Web(credentials); | |
transportWeb.DeliverAsync(myMessage); |
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] | |
# POST |