SlideShare uma empresa Scribd logo
1 de 40
Baixar para ler offline
HTML Emails in Rails 3



                 @johnbarton
 http://goodfil.ms : http://whoisjohnbarton.com
What do I want to do?
Design, and implement, and deploy a good looking HTML email that works
across all common desktop, web, and mobile clients with a fall back to text.
What do I know?
Writing HTML emails is painful
       Lots of mail clients broken in lots of ways.
        CSS support is neither CSS, nor support.
     Tables for layout, inline css for colours and shit
Testing HTML emails is painful
I literally have to send emails to a whole bunch of clients and look at them and
    if I got a single bloody thing wrong do the whole thing over from scratch.
...and it got even more painful
   iPhones, iPad, and Android mail clients are popular now.
        They are still broken AND have tiny screens.

              ...and I don’t even own an iPhone.
What don’t I know?
Is there a good way to do this in
             Rails 3?
     ... everything else is shiny and rad so I’d assume so.
Surely it’s as simple as:

gem install incredibly_useful_but_confusingly_named_email_thing
Let’s Google This Shit
Lots of “getting started” guides
    Not a lot of “here’s a good way to do the whole thing”
So over two weeks of TRY ALL
THE THINGS I’ve settled on a
decent toolchain and process.
           YMMV.
Step 1: Find a base to work on
This is important
 A lot of people have put in a lot of effort working out the “generic” kinks in all
the different email clients and there is NO NEED for you to replicate the effort
You can use an off the shelf
         template
 http://themeforest.net/category/marketing/email-templates
                             or
         http://www.campaignmonitor.com/templates/
Or use boilerplate
  http://htmlemailboilerplate.com/
Pro-tip #1: mix haml & erb
  Stick with ERB for your outermost layout, as it’s the smaller diff from your
     boilerplate, and you’ll want to update that as the boilerplate evolves.

Use haml for everything inside there as it makes all the nested tables easier to
                                   manage
Step 2: Use sane tool for inlining
            your CSS
Premailer
 Pros: auto generates text part, popular, has “mail” in the name
Cons: Inlines everything, about 6 million forks with different shit
Roadie
Pros: Inline some stuff, leaves some alone, can use asset pipeline
                    Cons: Our build segfaults
Slide intentionally
     left blank
Protip #2: Take advantage of
     the asset pipeline
You often have to “pointlessly” repeat style info on different elements,
       SASS with mixins makes that not eye bleedingly painful
Step 3: Keep templates simple
 The tables make shit hard enough as is, don’t put any logic in there
Protip #3: Use Presenters
Push logic in there, it’s easy to test. Push copy in there, makes keeping HTML +
                              Text parts in sync easier.
Protip #4: Use partials as
             layouts
Isolate your tables from your content for more smiles and less swears.
Step 4: Smooth out your
     feedback loop
TDD & F5DD
Either works well in Rails for web stuff, but no one has nailed it for email yet
This is the tricky bit.
You want to work in layers.
Do 90% of the work in the
       browser
Where you are held in the warm embrace of the web inspector.
Then email to yourself
This catches a bunch of “I have a fundamentally wrong assumption about
 something that works in the browser will work in at least 1 mail client”

                       You will have lots of those.
Then use one of the “magic”
           testing apps
I use http://litmus.com, but http://emailonacid.com looks good too and has a
        name that suggests what happened on the Office 2007 team
Only move up a layer when
  you’ve 100% nailed it
   And when you screw up, go back to level one.
Step 5: Profit?
SIGN UP TO
GOODFILMS

Mais conteúdo relacionado

Mais procurados

Creating File Paths in HTML
Creating File Paths in HTMLCreating File Paths in HTML
Creating File Paths in HTMLJenna Kammer
 
How to embed a google calendar in a twinspace page
How to embed a google calendar in a twinspace pageHow to embed a google calendar in a twinspace page
How to embed a google calendar in a twinspace pagePetros Michailidis
 
How to Make WordPress Your Friend
How to Make WordPress Your FriendHow to Make WordPress Your Friend
How to Make WordPress Your Friendkerchmcc
 
HTML and blogging lesson 1
HTML and blogging lesson 1HTML and blogging lesson 1
HTML and blogging lesson 1MrsAtherton
 
Worry Free Web Development
Worry Free Web DevelopmentWorry Free Web Development
Worry Free Web DevelopmentAra Pehlivanian
 
Getting the word_out
Getting the word_outGetting the word_out
Getting the word_outMike Minions
 
Accessing eBooks
Accessing eBooksAccessing eBooks
Accessing eBooksiSkillsTav
 
How to Use IFTTT to Automate your Virtual Life
How to Use IFTTT to Automate your  Virtual Life How to Use IFTTT to Automate your  Virtual Life
How to Use IFTTT to Automate your Virtual Life Aimee Emejas
 
Accessing eBooks
Accessing eBooksAccessing eBooks
Accessing eBooksiSkillsTav
 
Michaelz Prsentation
Michaelz PrsentationMichaelz Prsentation
Michaelz Prsentation14mjun
 
Act! Tips by Tech Benders
Act! Tips by Tech BendersAct! Tips by Tech Benders
Act! Tips by Tech BendersTech Benders
 
How to start a blog step-by-step guide
How to start a blog   step-by-step guideHow to start a blog   step-by-step guide
How to start a blog step-by-step guideKaran Labra
 
Cyber-security tips: the heartbleed bug
Cyber-security tips: the heartbleed bugCyber-security tips: the heartbleed bug
Cyber-security tips: the heartbleed bugDebbie Elicksen
 
ACCESSING GOOGLE APPS - FAQ
ACCESSING GOOGLE APPS - FAQACCESSING GOOGLE APPS - FAQ
ACCESSING GOOGLE APPS - FAQLadbs WebEmail
 

Mais procurados (20)

Creating File Paths in HTML
Creating File Paths in HTMLCreating File Paths in HTML
Creating File Paths in HTML
 
How To Create A Website With The Use
How To Create A Website With The UseHow To Create A Website With The Use
How To Create A Website With The Use
 
How to embed a google calendar in a twinspace page
How to embed a google calendar in a twinspace pageHow to embed a google calendar in a twinspace page
How to embed a google calendar in a twinspace page
 
WordCamp Baltimore 2016
WordCamp Baltimore 2016WordCamp Baltimore 2016
WordCamp Baltimore 2016
 
How to Make WordPress Your Friend
How to Make WordPress Your FriendHow to Make WordPress Your Friend
How to Make WordPress Your Friend
 
HTML and blogging lesson 1
HTML and blogging lesson 1HTML and blogging lesson 1
HTML and blogging lesson 1
 
Setting up Skype
Setting up SkypeSetting up Skype
Setting up Skype
 
Document
DocumentDocument
Document
 
Worry Free Web Development
Worry Free Web DevelopmentWorry Free Web Development
Worry Free Web Development
 
Getting the word_out
Getting the word_outGetting the word_out
Getting the word_out
 
Accessing eBooks
Accessing eBooksAccessing eBooks
Accessing eBooks
 
How to Use IFTTT to Automate your Virtual Life
How to Use IFTTT to Automate your  Virtual Life How to Use IFTTT to Automate your  Virtual Life
How to Use IFTTT to Automate your Virtual Life
 
Accessing eBooks
Accessing eBooksAccessing eBooks
Accessing eBooks
 
Michaelz Prsentation
Michaelz PrsentationMichaelz Prsentation
Michaelz Prsentation
 
Act! Tips by Tech Benders
Act! Tips by Tech BendersAct! Tips by Tech Benders
Act! Tips by Tech Benders
 
How to start a blog step-by-step guide
How to start a blog   step-by-step guideHow to start a blog   step-by-step guide
How to start a blog step-by-step guide
 
1 1 Completed
1 1 Completed1 1 Completed
1 1 Completed
 
php lesson 1
php lesson 1php lesson 1
php lesson 1
 
Cyber-security tips: the heartbleed bug
Cyber-security tips: the heartbleed bugCyber-security tips: the heartbleed bug
Cyber-security tips: the heartbleed bug
 
ACCESSING GOOGLE APPS - FAQ
ACCESSING GOOGLE APPS - FAQACCESSING GOOGLE APPS - FAQ
ACCESSING GOOGLE APPS - FAQ
 

Destaque

Extreme Tiered Storage Flash, Disk, And Cloud
Extreme Tiered Storage Flash, Disk, And CloudExtreme Tiered Storage Flash, Disk, And Cloud
Extreme Tiered Storage Flash, Disk, And CloudStephen Foskett
 
Key to Efficient Tiered Storage Infrastructure
Key to Efficient Tiered  Storage InfrastructureKey to Efficient Tiered  Storage Infrastructure
Key to Efficient Tiered Storage InfrastructureIMEX Research
 
融合存储技术
融合存储技术融合存储技术
融合存储技术Liang Ming
 
Software defined storage real or bs-2014
Software defined storage real or bs-2014Software defined storage real or bs-2014
Software defined storage real or bs-2014Howard Marks
 
Tiered Storage and Archiving by PoINT Storage Manager
Tiered Storage and Archiving by PoINT Storage ManagerTiered Storage and Archiving by PoINT Storage Manager
Tiered Storage and Archiving by PoINT Storage ManagerPoINT Software & Systems GmbH
 

Destaque (7)

Flash disk
Flash diskFlash disk
Flash disk
 
Extreme Tiered Storage Flash, Disk, And Cloud
Extreme Tiered Storage Flash, Disk, And CloudExtreme Tiered Storage Flash, Disk, And Cloud
Extreme Tiered Storage Flash, Disk, And Cloud
 
Key to Efficient Tiered Storage Infrastructure
Key to Efficient Tiered  Storage InfrastructureKey to Efficient Tiered  Storage Infrastructure
Key to Efficient Tiered Storage Infrastructure
 
融合存储技术
融合存储技术融合存储技术
融合存储技术
 
Software defined storage real or bs-2014
Software defined storage real or bs-2014Software defined storage real or bs-2014
Software defined storage real or bs-2014
 
Tiered Storage and Archiving by PoINT Storage Manager
Tiered Storage and Archiving by PoINT Storage ManagerTiered Storage and Archiving by PoINT Storage Manager
Tiered Storage and Archiving by PoINT Storage Manager
 
Storage for VDI
Storage for VDIStorage for VDI
Storage for VDI
 

Semelhante a HTML Emails in Rails 3

Samples - web design, blog posts, and infographics
Samples - web design, blog posts, and infographicsSamples - web design, blog posts, and infographics
Samples - web design, blog posts, and infographicsErik Boman
 
AWDG - Comp to Code to Inbox
AWDG - Comp to Code to InboxAWDG - Comp to Code to Inbox
AWDG - Comp to Code to InboxFabio Carneiro
 
HTML email best practices
HTML email best practicesHTML email best practices
HTML email best practicesJeffrey Barke
 
HTML email best practices
HTML email best practicesHTML email best practices
HTML email best practicesJeffrey Barke
 
Maintainable Javascript carsonified
Maintainable Javascript carsonifiedMaintainable Javascript carsonified
Maintainable Javascript carsonifiedChristian Heilmann
 
Code This, Not That: 10 Do's and Don'ts For Learning HTML
Code This, Not That: 10 Do's and Don'ts For Learning HTMLCode This, Not That: 10 Do's and Don'ts For Learning HTML
Code This, Not That: 10 Do's and Don'ts For Learning HTMLHubSpot
 
Top 10 Scalability Mistakes
Top 10 Scalability MistakesTop 10 Scalability Mistakes
Top 10 Scalability MistakesJohn Coggeshall
 
Get response increase-your-emails-impact
Get response increase-your-emails-impactGet response increase-your-emails-impact
Get response increase-your-emails-impactbakor Balla
 
Responsive HTML Email with Drupal
Responsive HTML Email with DrupalResponsive HTML Email with Drupal
Responsive HTML Email with DrupalDrew Gorton
 
Girl Scouts Website Designer Badge Seminar - Workbook
Girl Scouts Website Designer Badge Seminar - WorkbookGirl Scouts Website Designer Badge Seminar - Workbook
Girl Scouts Website Designer Badge Seminar - WorkbookLauren Hayward Schaefer
 
Going native with html5 web components
Going native with html5 web componentsGoing native with html5 web components
Going native with html5 web componentsJames York
 
Single sourcing to the max
Single sourcing to the maxSingle sourcing to the max
Single sourcing to the maxNeil Perlin
 
Html journal chris kweks (microbold)
Html journal   chris kweks (microbold)Html journal   chris kweks (microbold)
Html journal chris kweks (microbold)Chris Kwekowe
 
Extreme optimization good
Extreme optimization goodExtreme optimization good
Extreme optimization goodmatt433
 
Thriving in the Chaotic World of Email Design
Thriving in the Chaotic World of Email DesignThriving in the Chaotic World of Email Design
Thriving in the Chaotic World of Email DesignVivastream
 
The Email Circle of Life
The Email Circle of LifeThe Email Circle of Life
The Email Circle of LifeMarketo
 

Semelhante a HTML Emails in Rails 3 (20)

Samples - web design, blog posts, and infographics
Samples - web design, blog posts, and infographicsSamples - web design, blog posts, and infographics
Samples - web design, blog posts, and infographics
 
Trigger Emails BigD17
Trigger Emails BigD17Trigger Emails BigD17
Trigger Emails BigD17
 
Dopp xhtml tutorial
Dopp xhtml tutorialDopp xhtml tutorial
Dopp xhtml tutorial
 
AWDG - Comp to Code to Inbox
AWDG - Comp to Code to InboxAWDG - Comp to Code to Inbox
AWDG - Comp to Code to Inbox
 
Creative Guidelines
Creative GuidelinesCreative Guidelines
Creative Guidelines
 
Html
HtmlHtml
Html
 
HTML email best practices
HTML email best practicesHTML email best practices
HTML email best practices
 
HTML email best practices
HTML email best practicesHTML email best practices
HTML email best practices
 
Maintainable Javascript carsonified
Maintainable Javascript carsonifiedMaintainable Javascript carsonified
Maintainable Javascript carsonified
 
Code This, Not That: 10 Do's and Don'ts For Learning HTML
Code This, Not That: 10 Do's and Don'ts For Learning HTMLCode This, Not That: 10 Do's and Don'ts For Learning HTML
Code This, Not That: 10 Do's and Don'ts For Learning HTML
 
Top 10 Scalability Mistakes
Top 10 Scalability MistakesTop 10 Scalability Mistakes
Top 10 Scalability Mistakes
 
Get response increase-your-emails-impact
Get response increase-your-emails-impactGet response increase-your-emails-impact
Get response increase-your-emails-impact
 
Responsive HTML Email with Drupal
Responsive HTML Email with DrupalResponsive HTML Email with Drupal
Responsive HTML Email with Drupal
 
Girl Scouts Website Designer Badge Seminar - Workbook
Girl Scouts Website Designer Badge Seminar - WorkbookGirl Scouts Website Designer Badge Seminar - Workbook
Girl Scouts Website Designer Badge Seminar - Workbook
 
Going native with html5 web components
Going native with html5 web componentsGoing native with html5 web components
Going native with html5 web components
 
Single sourcing to the max
Single sourcing to the maxSingle sourcing to the max
Single sourcing to the max
 
Html journal chris kweks (microbold)
Html journal   chris kweks (microbold)Html journal   chris kweks (microbold)
Html journal chris kweks (microbold)
 
Extreme optimization good
Extreme optimization goodExtreme optimization good
Extreme optimization good
 
Thriving in the Chaotic World of Email Design
Thriving in the Chaotic World of Email DesignThriving in the Chaotic World of Email Design
Thriving in the Chaotic World of Email Design
 
The Email Circle of Life
The Email Circle of LifeThe Email Circle of Life
The Email Circle of Life
 

Mais de John Barton

GopherCon 2014 Recap for Melbourne Go Group
GopherCon 2014 Recap for Melbourne Go GroupGopherCon 2014 Recap for Melbourne Go Group
GopherCon 2014 Recap for Melbourne Go GroupJohn Barton
 
Minimum Viable Architecture For Web Apps
Minimum Viable Architecture For Web AppsMinimum Viable Architecture For Web Apps
Minimum Viable Architecture For Web AppsJohn Barton
 
Webscale for the rest of us ruby conf 2013
Webscale for the rest of us   ruby conf 2013Webscale for the rest of us   ruby conf 2013
Webscale for the rest of us ruby conf 2013John Barton
 
Envato Dev Ops - Alt.Net Melbourne
Envato Dev Ops - Alt.Net MelbourneEnvato Dev Ops - Alt.Net Melbourne
Envato Dev Ops - Alt.Net MelbourneJohn Barton
 
Dev Ops @ Envato
Dev Ops @ EnvatoDev Ops @ Envato
Dev Ops @ EnvatoJohn Barton
 
Production is a bitch
Production is a bitchProduction is a bitch
Production is a bitchJohn Barton
 
Lean Manufacturing and Thought Experiments
Lean Manufacturing and Thought ExperimentsLean Manufacturing and Thought Experiments
Lean Manufacturing and Thought ExperimentsJohn Barton
 
Lazy Loading and Object Proxying Shenangians
Lazy Loading and Object Proxying ShenangiansLazy Loading and Object Proxying Shenangians
Lazy Loading and Object Proxying ShenangiansJohn Barton
 
Ruby Nuby Session - Rails Intro
Ruby Nuby Session - Rails IntroRuby Nuby Session - Rails Intro
Ruby Nuby Session - Rails IntroJohn Barton
 
Alltimetop5 @ Webjam, ReMix 07
Alltimetop5 @ Webjam, ReMix 07Alltimetop5 @ Webjam, ReMix 07
Alltimetop5 @ Webjam, ReMix 07John Barton
 

Mais de John Barton (10)

GopherCon 2014 Recap for Melbourne Go Group
GopherCon 2014 Recap for Melbourne Go GroupGopherCon 2014 Recap for Melbourne Go Group
GopherCon 2014 Recap for Melbourne Go Group
 
Minimum Viable Architecture For Web Apps
Minimum Viable Architecture For Web AppsMinimum Viable Architecture For Web Apps
Minimum Viable Architecture For Web Apps
 
Webscale for the rest of us ruby conf 2013
Webscale for the rest of us   ruby conf 2013Webscale for the rest of us   ruby conf 2013
Webscale for the rest of us ruby conf 2013
 
Envato Dev Ops - Alt.Net Melbourne
Envato Dev Ops - Alt.Net MelbourneEnvato Dev Ops - Alt.Net Melbourne
Envato Dev Ops - Alt.Net Melbourne
 
Dev Ops @ Envato
Dev Ops @ EnvatoDev Ops @ Envato
Dev Ops @ Envato
 
Production is a bitch
Production is a bitchProduction is a bitch
Production is a bitch
 
Lean Manufacturing and Thought Experiments
Lean Manufacturing and Thought ExperimentsLean Manufacturing and Thought Experiments
Lean Manufacturing and Thought Experiments
 
Lazy Loading and Object Proxying Shenangians
Lazy Loading and Object Proxying ShenangiansLazy Loading and Object Proxying Shenangians
Lazy Loading and Object Proxying Shenangians
 
Ruby Nuby Session - Rails Intro
Ruby Nuby Session - Rails IntroRuby Nuby Session - Rails Intro
Ruby Nuby Session - Rails Intro
 
Alltimetop5 @ Webjam, ReMix 07
Alltimetop5 @ Webjam, ReMix 07Alltimetop5 @ Webjam, ReMix 07
Alltimetop5 @ Webjam, ReMix 07
 

Último

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 

Último (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

HTML Emails in Rails 3

  • 1. HTML Emails in Rails 3 @johnbarton http://goodfil.ms : http://whoisjohnbarton.com
  • 2. What do I want to do? Design, and implement, and deploy a good looking HTML email that works across all common desktop, web, and mobile clients with a fall back to text.
  • 3. What do I know?
  • 4. Writing HTML emails is painful Lots of mail clients broken in lots of ways. CSS support is neither CSS, nor support. Tables for layout, inline css for colours and shit
  • 5. Testing HTML emails is painful I literally have to send emails to a whole bunch of clients and look at them and if I got a single bloody thing wrong do the whole thing over from scratch.
  • 6. ...and it got even more painful iPhones, iPad, and Android mail clients are popular now. They are still broken AND have tiny screens. ...and I don’t even own an iPhone.
  • 8. Is there a good way to do this in Rails 3? ... everything else is shiny and rad so I’d assume so.
  • 9. Surely it’s as simple as: gem install incredibly_useful_but_confusingly_named_email_thing
  • 11.
  • 12. Lots of “getting started” guides Not a lot of “here’s a good way to do the whole thing”
  • 13. So over two weeks of TRY ALL THE THINGS I’ve settled on a decent toolchain and process. YMMV.
  • 14. Step 1: Find a base to work on
  • 15. This is important A lot of people have put in a lot of effort working out the “generic” kinks in all the different email clients and there is NO NEED for you to replicate the effort
  • 16. You can use an off the shelf template http://themeforest.net/category/marketing/email-templates or http://www.campaignmonitor.com/templates/
  • 17. Or use boilerplate http://htmlemailboilerplate.com/
  • 18. Pro-tip #1: mix haml & erb Stick with ERB for your outermost layout, as it’s the smaller diff from your boilerplate, and you’ll want to update that as the boilerplate evolves. Use haml for everything inside there as it makes all the nested tables easier to manage
  • 19. Step 2: Use sane tool for inlining your CSS
  • 20.
  • 21. Premailer Pros: auto generates text part, popular, has “mail” in the name Cons: Inlines everything, about 6 million forks with different shit
  • 22. Roadie Pros: Inline some stuff, leaves some alone, can use asset pipeline Cons: Our build segfaults
  • 23. Slide intentionally left blank
  • 24. Protip #2: Take advantage of the asset pipeline You often have to “pointlessly” repeat style info on different elements, SASS with mixins makes that not eye bleedingly painful
  • 25. Step 3: Keep templates simple The tables make shit hard enough as is, don’t put any logic in there
  • 26. Protip #3: Use Presenters Push logic in there, it’s easy to test. Push copy in there, makes keeping HTML + Text parts in sync easier.
  • 27.
  • 28.
  • 29. Protip #4: Use partials as layouts Isolate your tables from your content for more smiles and less swears.
  • 30.
  • 31. Step 4: Smooth out your feedback loop
  • 32. TDD & F5DD Either works well in Rails for web stuff, but no one has nailed it for email yet
  • 33.
  • 34. This is the tricky bit. You want to work in layers.
  • 35. Do 90% of the work in the browser Where you are held in the warm embrace of the web inspector.
  • 36. Then email to yourself This catches a bunch of “I have a fundamentally wrong assumption about something that works in the browser will work in at least 1 mail client” You will have lots of those.
  • 37. Then use one of the “magic” testing apps I use http://litmus.com, but http://emailonacid.com looks good too and has a name that suggests what happened on the Office 2007 team
  • 38. Only move up a layer when you’ve 100% nailed it And when you screw up, go back to level one.