codecamp iași 2014 - vincent van scherpenseel - transactional e-mail

55
The Importance of Transactional E-mail CodeCamp Iasi Vincent van Scherpenseel

Upload: dotblue

Post on 05-Dec-2014

277 views

Category:

Internet


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

The Importance of

Transactional E-mail

CodeCamp Iasi Vincent van Scherpenseel

Page 2: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

ProgramIntroduction What is transactional e-mail.

Page 3: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

ProgramIntroduction What is transactional e-mail.

Use-cases When and where to use it.

Page 4: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

ProgramIntroduction What is transactional e-mail.

Use-cases When and where to use it.

Implementation Sending e-mail from your website or app.

Page 5: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

ProgramIntroduction What is transactional e-mail.

Use-cases When and where to use it.

Implementation Sending e-mail from your website or app.

Templating How to make it look good.

Page 6: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

ProgramIntroduction What is transactional e-mail.

Use-cases When and where to use it.

Implementation Sending e-mail from your website or app.

Templating How to make it look good.

Optimization How to measure and optimize for success.

Page 7: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

What is transactional e-mail?

A personal e-mail sent to a single individual usually

based on an action they performed.

Page 8: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

How to send it?

Your own mail server. Third-party service.

Page 9: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Why out-source it?

1. Deliverability

2. Maintenance

3. Actionable insights

4. Increase revenue, decrease costs+

Page 10: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Third-party services

Page 11: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Use-cases When and where to use it.

Page 12: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Account actions

Page 13: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Registration confirmation

Page 14: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Event announcements

Page 15: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Back-in-stock notification

Page 16: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Review request

Page 17: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Personal discount campaigns

Page 18: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Personal motivation

Page 19: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Webhooks!

Don’t let hard-bounces lead to dead-ends.

Page 20: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Implementation Sending e-mail from your website or app.

Page 21: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Sending Method

SMTP API

Page 22: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

SMTP

! SMTP Host: smtp.mandrillapp.com! SMTP Port: 587! Username: $yourUsername! Password: $yourApiKey

Page 23: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

SMTP

Easy to set up and useful for: • Sending system e-mails • Sending personal e-mails • Cases where API integration is impossible

Page 24: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

API

The Right Way™ • Usually offers more functionality • No need for additional SMTP library • Much nicer code

Page 25: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

API{

"key": "$yourApiKey", "template_name": “codecamp2014", "template_content": [ { "name": "name", "content": “Vincent van Scherpenseel" } ], "message": { "subject": “Thank you for your registration!", "from_email": “[email protected]”, "from_name": "CodeCamp", "to": [ { "email": “[email protected]”, "name": “Vincent van Scherpenseel", "type": "to" } ], "track_opens": true, "track_clicks": true, [..]

Page 26: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

API wrappers

Generic PHP wrappergithub.com/dotblue/Mandrill

.Net wrappergithub.com/shawnmclean/Mandrill-

dotnet

Page 27: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

[..]! "attachments": [ { "type": "application/pdf", "name": "contract_007.pdf", "content": base64_encode($pdfContents) } ],! [..]

Sending Attachments

Page 28: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

[..]! "attachments": [ { "type": "application/pdf", "name": "contract_007.pdf", "content": base64_encode($pdfContents) } ],! [..]

Sending Attachments

Page 29: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Don’t Slow Down the User!

Use the async-flag and catch exceptions.

[..]! "async": false,! [..]

Page 30: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Prepare for the Worst

Although rarely, downtime happens. So use a queue. !

• Poor man’s solution: crontab + database • Rich man’s solution: job manager

Page 31: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Watch your Reputation

Sending quota}Reputation score}Deliverability ratio}

Page 32: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Sender Policy Framework

Use SPF to define which hosts are allowed to send e-mail.

local:~ vincent$ host -t txt saleschamp.nl!saleschamp.nl descriptive text "v=spf1 a include:_spf.google.com include:spf.mandrillapp.com ~all"!!local:~ vincent$ host -t txt spf.mandrillapp.com!spf.mandrillapp.com descriptive text "v=spf1 ip4:198.2.128.0/24 ip4:198.2.132.0/22 ip4:205.201.131.128/25 ip4:205.201.134.128/25 ip4:205.201.136.0/23 ip4:205.201.139.0/24 ?all"

Page 33: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

DomainKeys Identified Mail

DKIM proves that an e-mail belongs to a specific domain name. Encryption proves e-mail has not been tampered with while in transit.

local:~ vincent$ host -t txt mandrill._domainkey.saleschamp.nl!mandrill._domainkey.saleschamp.nl descriptive text "k=rsa\; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrLHiExVd55zd/IQ/J/mRwSRMAocV/hMB3jXwaHH36d9NaVynQFYV8NaWi69c1veUtRzGt7yAioXqLj7Z4TeEUoOLgrKsn8YnckGs9i3B3tVFB+Ch/4mPhXWiNfNdynHWBcPcbJ8kjEQ2U8y78dHZj1YeRXXVvWob2OaKynO8/lQIDAQAB\;"

Page 34: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Use Sub-Accounts

Useful for: • Test environments • System e-mail • Multi-tenant situations

[..]! "subaccount": "development-env",! [..]

Sub-accounts have their own reputation.

Page 35: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Templates How to make it look good.

Page 36: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Best Practices

• Understand what you want to achieve. • Have a very clear call-to-action. • Make images clickable (remember fallbacks). • Design for a maximum width of 600 px. • Web fonts support is extremely limited. E-mail client CSS support overview:http://tinyurl.com/emailcss

Page 37: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Responsive Web Design

Photo: Brad Frost

Page 38: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Responsive Web Design

Support for media queries on mobile devices is pretty good! Except for Google Mail. Useful overview: www.campaignmonitor.com/guides/ mobile/

Page 39: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Testing

From $79 per month.www.litmus.com

Spam filter testing from $149 per month.

From $45 per month.www.emailonacid.com

Spam filter testing included.

Page 40: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Actions in the Inbox

• Based on an open-standard (schema.org) • Allows you to perform actions immediately

from your inbox • Easy to implement, using JSON-LD

Page 41: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Actions in the Inbox

• Based on an open-standard (schema.org) • Allows you to perform actions immediately

from your inbox • Easy to implement, using JSON-LD

    <script type="application/ld+json">    {      "@context":              "http://schema.org",      "@type":                 "EventReservation",      "reservationNumber":     "IO12345",      "underName": {        "@type":               "Person",        "name":                "John Smith"      },      "reservationFor": {        "@type":               "Event",        "name":                "Google I/O 2013",        "startDate":           "2013-05-15T08:30:00-08:00",        "location": {          "@type":             "Place",          "name":              "Moscone Center",          "address": {            "@type":           "PostalAddress",            "streetAddress":   "800 Howard St.",            "addressLocality": "San Francisco",            "addressRegion":   "CA",            "postalCode":      "94103",            "addressCountry":  "US"          }        }      }

Page 42: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Actions in the Inbox

Review ActionsInitiate the reviews directly from the inbox.

Page 43: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Actions in the Inbox

One Click Actions Users perform actions without visiting your site.

Page 44: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Actions in the Inbox

Reservations Actions Display information in the same consistent way.Let users check in directly from their inbox.

Page 45: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Optimization How to measure and optimize for success.

Page 46: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Key Performance Indicators

• Deliverability (bounces & rejects)

• Opens

• Clicks

• Conversions

Page 47: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

A/B testing

A/B testing your e-mails isas important as testing your website.

[..]! "tags": [ "password-reset" ],! [..]

Page 48: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

A/B testing

A/B testing your e-mails isas important as testing your website.

Page 49: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Google Analytics

Auto-tag your transactional e-mailfor Google Analytics tracking.

[..]! "google_analytics_domains": [ “codecamp.ro” ], "google_analytics_campaign": "registration_confirmation",! [..]

Page 50: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Respect your recipients

Use all data you have on your subscribers.

Page 51: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Measure the right things

Page 52: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Measure the right things

Having a lot of conversions does notmean you make the most money.

Page 53: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

Key Take-Aways

• Don’t ignore this powerful medium.E-mail is far from dead.

• Use a full API integration.And provide the best User Experience.

• Templating sucks, but we have RWD! Make sure to test properly.

• Monitor your KPIs.Always Be Optimizing.

Page 54: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

We’re hiring!

www.dotblue.net/jobswww.dotblue.ro/posturi

Page 55: CodeCamp Iași 2014 - Vincent van Scherpenseel - Transactional E-mail

http://vincent.io @vanscherpenseel

Vincent van [email protected]

Thank you!