SlideShare una empresa de Scribd logo
1 de 40
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (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
 

Destacado

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
 

Destacado (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
 

Similar 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
 

Similar 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
 

Más 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
 

Más 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

SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 

Último (20)

SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 

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.