This example uses cURL with PHP through our web API to send an email.
<?php $url = 'http://sendgrid.com/';
$user = 'USERNAME';
$pass = 'PASSWORD';
$params = array(
'api_user' => $user,
'api_key' => $pass,
httpClient.DefaultRequestHeaders.Authorization = | |
new AuthenticationHeaderValue( | |
"Basic", | |
Convert.ToBase64String( | |
System.Text.ASCIIEncoding.ASCII.GetBytes( | |
string.Format("{0}:{1}", username, password)))); |
require 'rubygems' | |
require 'json' | |
require 'nokogiri' | |
require 'nokogiri-pretty' | |
require 'iconv' | |
require 'pandoc-ruby' | |
require 'fileutils' | |
#convert HTML to markdown | |
html_files = File.join("/Users/brandonwest/SendGrid/docs/source", "**", "*.html") |
This example uses cURL with PHP through our web API to send an email.
<?php $url = 'http://sendgrid.com/';
$user = 'USERNAME';
$pass = 'PASSWORD';
$params = array(
'api_user' => $user,
'api_key' => $pass,
#Generates a named anchor and wrapping tag from a string. | |
module Jekyll | |
class AnchorBlock < Liquid::Block | |
def initialize(tag_name, markup, tokens) | |
@tag = markup | |
super | |
end | |
def render(context) |
require 'rubygems' | |
require 'pony' | |
#set the default options | |
Pony.options = { | |
:from => 'demo@sendgrid.com', | |
:via => :smtp, | |
:via_options => { | |
:address => 'smtp.sendgrid.net', | |
:port => '587', |
$(function() { | |
//callback we must supply to the widget to interact with our server-side code | |
//must take 3 parameters: email, fingerprint, and app_code | |
//must return a jQuery POST request object | |
var callback = function(email, fingerprint, kickbox_app_code){ | |
return $.post( "/authenticate", { | |
email: email, | |
fingerprint: fingerprint, | |
kickbox_app_code: kickbox_app_code, |
Today we're going to build a node.js application to collect email addresses using Kickbox. We'll be using Express and Request on the server side, and jQuery on the client.
We'll be using Glitch during this tutorial, because it provides an environment, editor, and hosting in one convenient package. There's an example of the completed project too. If you want to follow along in your own environment, all of the code will work.
Recipient Authentication makes it easy to collect email addresses the right way. We handle account activation, double email opt-in subscriptions, and password resets. We make sure the email gets delivered, send drip reminders, expire old links, handle opt-outs, and automatically add authenticated addresses to your email service provider or marketing platform.
require 'digest/md5' | |
module Jekyll | |
# Add accessor for directory | |
class Page | |
attr_reader :dir | |
end | |
class NavTree < Liquid::Tag | |
def render(context) |
{ | |
"personalizations": [{ | |
"to": [{ | |
"email": "anna@example.com" | |
}], | |
"cc": [{ | |
"email": "bill@example.com" | |
}, { | |
"email": "connie@example.com" | |
}, { |
{ | |
"from": { | |
"name": "B West", | |
"email": "brandon@sendgrid.com" | |
}, | |
"subject": "Mail v3 test", | |
"personalizations": [{ | |
"to": [{ | |
"name": "gYDXLV jeZLCy0VdiuU", | |
"email": "DuxWsA@sink.sendgrid.net" |