Skip to content

Instantly share code, notes, and snippets.

View sendgrid-gists's full-sized avatar

SendGrid DX sendgrid-gists

View GitHub Profile
@sendgrid-gists
sendgrid-gists / v3-hello-email.rb
Last active July 6, 2016 15:20
v3 "Hello World" for email, using SendGrid with Ruby.
# using SendGrid's Ruby Library
# https://github.com/sendgrid/sendgrid-ruby
require 'sendgrid-ruby'
include SendGrid
from = Email.new(email: '[email protected]')
to = Email.new(email: '[email protected]')
subject = 'Sending with SendGrid is Fun'
content = Content.new(type: 'text/plain', value: 'and easy to do anywhere, even with Ruby')
mail = Mail.new(from, subject, to, content)
@sendgrid-gists
sendgrid-gists / v3-hello-email.py
Last active April 6, 2019 04:00
v3 "Hello World" for email, using SendGrid with Python.
# using SendGrid's Python Library
# https://github.com/sendgrid/sendgrid-python
import os
from sendgrid import SendGridAPIClient
from sendgrid.helpers.mail import Mail
message = Mail(
from_email='[email protected]',
to_emails='[email protected]',
subject='Sending with Twilio SendGrid is Fun',
@sendgrid-gists
sendgrid-gists / v3-hello-email.go
Last active June 28, 2017 19:23
v3 "Hello World" for email, using SendGrid with Go.
// using SendGrid's Go Library
// https://github.com/sendgrid/sendgrid-go
package main
import (
"fmt"
"log"
"os"
"github.com/sendgrid/sendgrid-go"
@sendgrid-gists
sendgrid-gists / v3-hello-email.php
Last active August 9, 2018 17:07
v3 "Hello World" for email, using SendGrid with PHP.
<?php
require 'vendor/autoload.php'; // If you're using Composer (recommended)
// Comment out the above line if not using Composer
// require("<PATH TO>/sendgrid-php.php");
// If not using Composer, uncomment the above line and
// download sendgrid-php.zip from the latest release here,
// replacing <PATH TO> with the path to the sendgrid-php.php file,
// which is included in the download:
// https://github.com/sendgrid/sendgrid-php/releases
@sendgrid-gists
sendgrid-gists / v3-hello-email.java
Last active January 11, 2018 08:11
v3 "Hello World" for email, using SendGrid with Java.
// using SendGrid's Java Library
// https://github.com/sendgrid/sendgrid-java
import com.sendgrid.*;
import java.io.IOException;
public class Example {
public static void main(String[] args) throws IOException {
Email from = new Email("[email protected]");
String subject = "Sending with SendGrid is Fun";
Email to = new Email("[email protected]");
@sendgrid-gists
sendgrid-gists / v3-hello-email.cs
Last active February 14, 2017 12:15
v3 "Hello World" for email, using SendGrid with C#.
// using SendGrid's C# Library
// https://github.com/sendgrid/sendgrid-csharp
using SendGrid;
using SendGrid.Helpers.Mail;
using System;
using System.Threading.Tasks;
namespace Example
{
internal class Example
{
"category": [
"newuser"
],
"filters": {
"footer": {
"settings":
{
"enable": 1,
"text/plain": "Thank you for your business"
PATCH https://api.sendgrid.com/v3/mail_settings/spam_check HTTP/1.1
[
{
"sg_message_id":"sendgrid_internal_message_id",
"email": "[email protected]",
"timestamp": 1337197600,
"smtp-id": "<[email protected]>",
"event": "processed"
},
{
"sg_message_id":"sendgrid_internal_message_id",
POST https://api.sendgrid.com/v3/user/webhooks/parse/settings HTTP/1.1