HTML email best practices


Published on

Joint presentation with Scott Trudeau to the New York Web Standards Meetup on 22 October 2009.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

HTML email best practices

  1. 1. HTML email best practices New York Web Standards Meetup 22 October 2009 Scott Trudeau and Jeffrey Barke
  2. 2. Overview <ul><li>Design issues—How to build and test your HTML email </li></ul><ul><li>Email service providers—What they provide and why you should use them </li></ul><ul><li>Analytics integration—Track your campaign </li></ul><ul><li>List hygienics—Legal issues and best practices for your campaign </li></ul><ul><li>Standards? </li></ul>
  3. 3. 1. Design issues
  4. 4. Email clients… <ul><li>are a diverse lot! </li></ul><ul><li>Outlook 2007, Gmail, Lotus Notes! And they’re not always getting better. Outlook 2007 took a step backwards in rendering! </li></ul><ul><li>Campaign Monitor maintains a list of popular email clients and the CSS support of those clients: </li></ul><ul><li> </li></ul><ul><li> </li></ul>
  5. 5. Why HTML email? <ul><li>Given the state of email clients, why send HTML email? </li></ul><ul><li>Consistent branding </li></ul><ul><li>Better response rates </li></ul><ul><li>Additional tracking data (open rates) </li></ul><ul><li>Links can be displayed much shorted </li></ul><ul><li>Why not? </li></ul><ul><li>Not everyone can or chooses to receive HTML email </li></ul><ul><li>If done improperly, your email can be unreadable </li></ul>
  6. 6. HTML email design guidelines <ul><li>Campaign Monitor provides a few quick and dirty design guidelines: </li></ul><ul><li>Don’t waste your readers’ time </li></ul><ul><li>Permission matters </li></ul><ul><li>Relevance trumps permission </li></ul><ul><li>Make unsubscribing easy </li></ul><ul><li>Image blocking is common </li></ul><ul><li>Bring back tables </li></ul><ul><li>Add inline styles </li></ul><ul><li>Don’t forget your plain text version </li></ul><ul><li>Meet your legal obligations </li></ul><ul><li>Test, test, test </li></ul><ul><li>Source: Email design guidelines . Campaign Monitor </li></ul><ul><li>cont’d </li></ul>
  7. 7. Image blocking is common <ul><li>Many clients block images by default and require the user to click a link or button to make them visible. Given this, you cannot rely on people seeing your images. </li></ul><ul><li>Never design an email using all images! </li></ul><ul><li>Never use images for important content like headlines, links and any calls to action. </li></ul><ul><li>Add a text-based link to a web version of your design at the top of your email. </li></ul><ul><li>Get added to your recipient’s address book or whitelist. </li></ul><ul><li>Use alt text for all images for a better experience in Gmail. </li></ul><ul><li>Always add the height and width to the image to ensure that the blank placeholder image doesn’t munge your design. </li></ul><ul><li>Test your design with images turned off before you send it. </li></ul>
  8. 8. Add inline styles <ul><li>Some email clients remove CSS from the head, but Gmail will strip all CSS from the head or body except for inline styles. </li></ul><ul><li>Further, some email senders will strip CSS. In my experience, HTML attributes are superior to inline styles. </li></ul><ul><li>No CSS shorthand! </li></ul><ul><li>I've even had problems with #fff vs #FFFFFF. </li></ul>
  9. 9. Bring back tables (and janky markup) <ul><li>Email client support for floats and positioning is the worst, so for multi-column HTML email, it's back to structural tables. </li></ul><ul><li>However, plan them and attempt to minimize the nesting! </li></ul><ul><li>Put general font style information in the td, closest to content. Sitepoint does not recommend using the font tag, but I do. And it always works! </li></ul>
  10. 10. HTML email width <ul><li>HTML emails are read within email clients, most of which, even if maximized, do not use the full width of the screen to display email messages. </li></ul><ul><li>The recommendation is a fixed width of 550-600 pixels. </li></ul><ul><li>While height is not as important as width, the average preview pane is 300–500 pixels high, so the most important things should be visible there. </li></ul><ul><li>If using fluid layouts, set table width to 98%. Yahoo! mail needs a 1% cushion on either side. </li></ul>
  11. 11. Miscellaneous coding bits <ul><li>Use target=&quot;_blank&quot; for anchor tags. </li></ul><ul><li>Outlook 2007 ignores background images altogether. </li></ul><ul><li>If images have been stitched together, review carefully for the pixel shift. In other words, set inline images' display equal to block. </li></ul>
  12. 12. JavaScript in email? <ul><li>Nope! Gets stripped for security reasons. </li></ul>
  13. 13. Flash in email? <ul><li>The answer is no. </li></ul><ul><li>Campaign Monitor ran a test and none of the email clients tested displayed either the Flash or alternate content except Mac Mail, which did play the Flash movie. Further, Outlook 2003 and Outlook Express displayed an ActiveX security warning that had to be clicked prior to loading the message. After being clicked, neither the Flash nor the alternate content displayed. </li></ul><ul><li>Source: Using Flash in email . Campaign Monitor </li></ul>
  14. 14. HTML5 video in email? <ul><li>Surprisingly, yes! </li></ul><ul><li>Video plays in Apple Mail, Entourage 2008, MobileMe and the iPhone. All of the other clients display the fallback content. </li></ul><ul><li>Source: </li></ul>
  15. 15. Forms in email? <ul><li>Nope. </li></ul><ul><li>Email clients consider email forms to be a security risk. Some warn about the potential danger, others disable the form. </li></ul><ul><li>Forms are displayed in all major email clients except Outlook 2007. </li></ul><ul><li>However, the displayed forms are not functional in .Mac, Yahoo! Mail Classic, AOL Webmail, Windows Live Hotmail and Outlook 2003. </li></ul><ul><li>Source: Using forms in email . Campaign Monitor </li></ul>
  16. 16. Don't forget your plain text version <ul><li>Not all email clients support HTML. </li></ul><ul><li>Some email readers set their client to open plain text only. </li></ul><ul><li>Many email design tools will create a reasonable automatic translation of HTML enter plain text; much better than raw HTML or nothing; use it. </li></ul><ul><li>I couldn't locate these plain text templates on Campaign Monitor's site anymore: </li></ul>
  17. 17. Test, test, test <ul><li>Test in the browsers first and validate your code (as much as possible). If it works in Firefox and Internet Explorer, it will probably work in Outlook, Yahoo! and Google Mail. IE 6 is a good proxy for Outlook 2003. </li></ul><ul><li>Next, I test in actual email clients. I have accounts with Gmail, Hotmail, Yahoo!, Outlook Express, etc. And I wrote a simple emailer, so other people can test theirs too! </li></ul><ul><li>Finally, I run it through Campaign Monitor. </li></ul>
  18. 18. Test, test, test cont’d <ul><li>If it smells like spam… </li></ul><ul><li>Things to check: </li></ul><ul><li>Does the From address display properly (as a name, not a bare email address)? </li></ul><ul><li>Is the subject line correct? </li></ul><ul><li>Is the contact information correct and visually obvious? </li></ul><ul><li>Does the top of the email display the text, &quot;You received this email because ... Unsubscribe instructions are at the bottom of this email.&quot;? </li></ul><ul><li>Does your email contain text asking readers to add your from address to their email address book? </li></ul><ul><li>Does the top of your email include a link to the web version of the message? </li></ul>
  19. 19. 2. Email service providers
  20. 20. Email service providers <ul><li>Do I really need an Email Service Provider? </li></ul><ul><li>Yes </li></ul>
  21. 21. Why you need an ESP <ul><li>Ensuring deliverability is a full-time job </li></ul><ul><li>Stats (delivered, opened, bounced, etc.) </li></ul><ul><li>Subscribe/unsusbcribe APIs, integrated unsubscribe & list maintenance </li></ul><ul><li>Browser-based design tools </li></ul><ul><li>Technical assistance (e.g., SPF/DKIM) </li></ul><ul><li>Easy A/B testing & client testing </li></ul>
  22. 22. Recommended ESPs <ul><li>I've worked with many. For most people, my two favorites: </li></ul><ul><li>MailChimp </li></ul><ul><li>CampaignMonitor </li></ul><ul><li>Both have great marketing resources, template design help, strong UIs, good reporting, integrated testing, reasonable pricing and responsive tech support. </li></ul>
  23. 23. MailChimp <ul><li>Pay-as-you-go OR all you can eat monthly (for < 50,000 subscribers) </li></ul><ul><li>Good for few, smaller lists with frequent campaigns </li></ul>
  24. 24. CampaignMonitor <ul><li>Pay-as-you-go </li></ul><ul><li>White-label </li></ul><ul><li>Great when working with clients & larger lists w/ less frequent campaigns </li></ul><ul><li>Price </li></ul><ul><li>For every email sent to more than five people, you pay $5 plus a cent per recipient. If you purchase credits in advance, the rate decreases after the first 50,000 credits. </li></ul><ul><li>Source: http:// /pricing/ </li></ul>
  25. 25. CampaignMonitor cont’d <ul><li>Does not play well with others. </li></ul><ul><li>Unfortunately, Campaign Monitor does not seem to integrate with other platforms, or, if it does, it certainly doesn't make it as obvious as MailChip does. </li></ul><ul><li>Campaign Monitor does have an API, so this should be possible. </li></ul><ul><li>Since 37signals uses Campaign Monitor , not sure why it hasn't been done yet. </li></ul>
  26. 26. 3. Analytics integration
  27. 27. Google Analytics <ul><li>utm_campaign </li></ul><ul><li>The name of the marketing campaign the email belongs to. </li></ul><ul><li>utm_medium </li></ul><ul><li>Marketing medium. For HTML email campaigns, use email. </li></ul><ul><li>utm_source </li></ul><ul><li>The list of recipients you're sending the message to. </li></ul><ul><li>utm_content </li></ul><ul><li>Content of the email; can be useful to differentiate between version produced for an A/B test. </li></ul><ul><li>The campaign, medium and source parameters are all required, while the content parameter is optional. </li></ul><ul><li>Source: Tracking Email with Google Analytics . Analytics Talk </li></ul>
  28. 28. Google Analytics cont’d <ul><li>Tools </li></ul><ul><li>Google Analytics URL Builder </li></ul><ul><li>Problems </li></ul><ul><li>Two common problems: </li></ul><ul><li>People forget to tag their links </li></ul><ul><li>Sites sometimes have a redirect that strips the campaign tracking parameters. </li></ul><ul><li>Source: Tracking Email with Google Analytics . Analytics Talk </li></ul>
  29. 29. Google Analytics cont’d <ul><li>Privacy </li></ul><ul><li>While the email address of the visitor can be added using link tagging, the GA terms of service forbid the collecting of personally identifiable information. </li></ul><ul><li>Source: Tracking Email with Google Analytics . Analytics Talk </li></ul>
  30. 30. Google Analytics cont’d <ul><li>&quot;Direct&quot; vs &quot;other&quot; traffic sources: </li></ul>
  31. 31. Google Analytics cont’d
  32. 32. Google Analytics cont’d
  33. 33. 4. List hygienics
  34. 34. Keep your lists clean <ul><li>A clean list is a delivered list. Don't be a spammer. </li></ul><ul><li>Rules-of-thumb: </li></ul><ul><li>Get permission </li></ul><ul><li>Do not use pre-checked opt-in checkboxes </li></ul><ul><li>Use double opt-in </li></ul><ul><li>Don't break the (CAN-SPAM) law </li></ul><ul><li>And make it easy to unsubscribe! There's really no point in spamming anyone. </li></ul><ul><li>Source: Managing & Growing Your Subscriber List . CampaignMonitor </li></ul>
  35. 35. Keep your lists clean cont’d <ul><li>Scrub your list often (remove duplicates, compare against list of bad domains, remove role accounts.) </li></ul><ul><li>Remove &quot;spam&quot; email addresses (have the word spam in them) </li></ul><ul><li>Remove inactive addresses </li></ul>
  36. 36. 5. Standards?
  37. 37. The Email Standards Project <ul><li> </li></ul><ul><li>Rates the various email clients and works with email client developers to improve web standards support and accessibility in email: </li></ul><ul><li> / </li></ul>