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
class Fluent: | |
def __init__(self, cache=None): | |
self._cache = cache or [] | |
# Build the cache, and handle special cases | |
def _(self, name): | |
# Enables method chaining | |
return Fluent(self._cache+[name]) | |
# Final method call |
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
using System; | |
using System.Collections.Generic; | |
using System.Net.Mail; | |
using System.Linq; | |
using SendGrid; | |
namespace Example | |
{ | |
internal class Program | |
{ |
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 | |
from bs4 import BeautifulSoup | |
def send_email(self, to_email, from_email, subject, body): | |
message = sendgrid.Mail() | |
message.add_to(to_email) | |
message.set_subject(subject) | |
soup = BeautifulSoup(body, "html.parser") | |
message.set_text(soup.get_text()) | |
message.set_html(body) |
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
require 'sendgrid-ruby' | |
require 'dotenv' | |
Dotenv.load | |
sendgrid_apikey = ENV['SENDGRID_APIKEY'] | |
client = SendGrid::Client.new do |c| | |
c.api_key = sendgrid_apikey | |
end |
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')) | |
start_date = '2015-10-01' |
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" |
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 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 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] |