codecamp iași 2014 - vincent van scherpenseel - transactional e-mail
DESCRIPTION
TRANSCRIPT
The Importance of
Transactional E-mail
CodeCamp Iasi Vincent van Scherpenseel
ProgramIntroduction What is transactional e-mail.
ProgramIntroduction What is transactional e-mail.
Use-cases When and where to use it.
ProgramIntroduction What is transactional e-mail.
Use-cases When and where to use it.
Implementation Sending e-mail from your website or app.
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.
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.
What is transactional e-mail?
A personal e-mail sent to a single individual usually
based on an action they performed.
How to send it?
Your own mail server. Third-party service.
Why out-source it?
1. Deliverability
2. Maintenance
3. Actionable insights
4. Increase revenue, decrease costs+
Third-party services
Use-cases When and where to use it.
Account actions
Registration confirmation
Event announcements
Back-in-stock notification
Review request
Personal discount campaigns
Personal motivation
Webhooks!
Don’t let hard-bounces lead to dead-ends.
Implementation Sending e-mail from your website or app.
Sending Method
SMTP API
SMTP
! SMTP Host: smtp.mandrillapp.com! SMTP Port: 587! Username: $yourUsername! Password: $yourApiKey
SMTP
Easy to set up and useful for: • Sending system e-mails • Sending personal e-mails • Cases where API integration is impossible
API
The Right Way™ • Usually offers more functionality • No need for additional SMTP library • Much nicer code
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, [..]
API wrappers
Generic PHP wrappergithub.com/dotblue/Mandrill
.Net wrappergithub.com/shawnmclean/Mandrill-
dotnet
[..]! "attachments": [ { "type": "application/pdf", "name": "contract_007.pdf", "content": base64_encode($pdfContents) } ],! [..]
Sending Attachments
[..]! "attachments": [ { "type": "application/pdf", "name": "contract_007.pdf", "content": base64_encode($pdfContents) } ],! [..]
Sending Attachments
Don’t Slow Down the User!
Use the async-flag and catch exceptions.
[..]! "async": false,! [..]
Prepare for the Worst
Although rarely, downtime happens. So use a queue. !
• Poor man’s solution: crontab + database • Rich man’s solution: job manager
Watch your Reputation
Sending quota}Reputation score}Deliverability ratio}
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"
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\;"
Use Sub-Accounts
Useful for: • Test environments • System e-mail • Multi-tenant situations
[..]! "subaccount": "development-env",! [..]
Sub-accounts have their own reputation.
Templates How to make it look good.
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
Responsive Web Design
Photo: Brad Frost
Responsive Web Design
Support for media queries on mobile devices is pretty good! Except for Google Mail. Useful overview: www.campaignmonitor.com/guides/ mobile/
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.
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
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" } } }
Actions in the Inbox
Review ActionsInitiate the reviews directly from the inbox.
Actions in the Inbox
One Click Actions Users perform actions without visiting your site.
Actions in the Inbox
Reservations Actions Display information in the same consistent way.Let users check in directly from their inbox.
Optimization How to measure and optimize for success.
Key Performance Indicators
• Deliverability (bounces & rejects)
• Opens
• Clicks
• Conversions
A/B testing
A/B testing your e-mails isas important as testing your website.
[..]! "tags": [ "password-reset" ],! [..]
A/B testing
A/B testing your e-mails isas important as testing your website.
Google Analytics
Auto-tag your transactional e-mailfor Google Analytics tracking.
[..]! "google_analytics_domains": [ “codecamp.ro” ], "google_analytics_campaign": "registration_confirmation",! [..]
Respect your recipients
Use all data you have on your subscribers.
Measure the right things
Measure the right things
Having a lot of conversions does notmean you make the most money.
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.
We’re hiring!
www.dotblue.net/jobswww.dotblue.ro/posturi