Post on 08-Jan-2017
Scott Kawai Senior Product Support Engineer
SendGrid, Inc.
▪ With SendGrid for 3 years ▪ Support product design and new
features ▪ Help train people on using
SendGrid
▪ SendGrid is used to send a lot of important email.
Account information emails
Forgot password emails.
▪ SendGrid is always looking for ways to help you protect your
account and emails (i.e. 2FA and API Keys).
Account Security
▪ Allows you to specify specific IP addresses that can access your
account.
▪ All other IPs will be denied access, even if they have the correct
credentials.
▪ Restricts access to the website, SMTP, and API calls.
IP Access Management
▪ Provides a list of recent access attempts.
▪ Email alerts when an unauthorized IP attempts to login.
Historical Log
▪ Only whitelist “static” IP addresses that are yours.
i.e. Do not whitelist the IP address of a hotel you’re staying at.
▪ Be sure to whitelist all the IP addresses you access your account
from (including apps that are sending through SMTP or API).
▪ The feature can be disabled, but you have to log in to the account
from a whitelisted IP first.
Warnings
Sending Email Through SendGrid SMTP API
● Email Standard
● Easily integrates with many solutions
● “Chatty”
○ There is a lot of back and forth
communication between servers
● Not a standard
● Uses HTTP requests
● Faster
▪ Sent billions of emails.
▪ Multiple libraries available for multiple languages.
▪ Uses SendGrid’s “X-SMTPAPI” feature.
Web API V2
# POST /api/mail.send.json + Request (application/x-www-form-urlencoded) + Body api_user=username&api_key=password&from=scott%example.com&text=Hello+World&subject=Hello%21&to=test%40example.com&html=%3Ch1%3EHello+World%3C%2Fh1%3E
V2 Example
# POST /v3/mail/send/beta + Request (application/json) + Headers Authorization: Bearer SG.API_KEY + Body { "from": {"name": "Scott", "email": "scott@example.com"}, "subject": "Hello World", "personalization": [ { "to": [ {"name": "Test", "email": "test@sendgrid.com"} ] } ], "content": [ {"type": "text/plain", "value": "Hello World"}, {"type": "text/html", "value": "<h1>Hello World</h1>"} ] }
V3 Example
▪ Set up shared properties of an email.
▪ Add personalizations for individual recipients.
▪ Subject, From, CC, BCC, and headers can be personalized.
Personalization
{ "from": {"email": "scott@sendgrid.com"}, "personalization": [{ "to": [{"email": "john@sendgrid.com"}], "substitutions": { "%name%": "John" }, "subject": "Hello John" }, { "to": [{"email": "steve@sendgrid.com"}], "substitutions": { "%name%": "Steve" }, "subject": "Hello Steve" }], "content": [{ "type": "text/plain", "value": "Hello %name%" }, { "type": "text/html", "value": "<h1>Hello %name%</h1>" }] }
Personalization Example
▪ Supports plain text and HTML emails
▪ Allows multipart MIME content (for example, ICS content for
calendar invites).
Content
{ … "content": [{ "type": "text/plain", "value": "You’re Invited!" }, { "type": "text/html", "value": "<h1>You’re Invited!</h1>" }, { "type": "text/calendar", "value": "BEGIN:VEVENT\nSUMMARY:SendGrid Night\nUID:5248\nDESCRIPTION;ENCODING=QUOTED-PRINTABLE:Hello World\nDTSTART;TZID=/US/Eastern:20131109T100000\nDTEND;TZID=/US/Eastern:20131109T113000END:VEVENT" }] }
Content Example
▪ Easily add attachments within the JSON body.
▪ Base64 encode that attachment’s data.
▪ Supports inline image attachments (CID).
Attachments
{ … "attachments": [{ "content": "YWJjMTIzIT8kKiYoKSctPUB+", "type": "application/pdf", "filename": "document.pdf", "disposition": "attachment" }] }
Attachment Example
▪ V3 is currently in beta.
▪ Not recommended for production use.
▪ General availability in the coming months.
Public Beta
▪ Better contact management with list segmentation.
▪ Responsive drag and drop editor.
▪ Subscriber management.
Improvements
▪ Allows you to create a dynamic list based
off of search criteria.
▪ For instance, you can create a segment
for only recipients that have opened your
email in the past.
List Segmentation
▪ Drag and drop editor.
▪ Custom code editor.
▪ Drag and drop designs are automatically responsive for mobile
devices.
Campaign Editor
▪ Split testing.
▪ Detailed analytics.
▪ Premade templates.
▪ Custom fields for contacts.
Other Features