Skip to content

Instantly share code, notes, and snippets.

@strukturedkaos
Last active December 15, 2015 05:39
Show Gist options
  • Save strukturedkaos/5210835 to your computer and use it in GitHub Desktop.
Save strukturedkaos/5210835 to your computer and use it in GitHub Desktop.
Railscast Example of HTML Email with CSS
!!!
%html
%head
%meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"}/
%title RailsCasts Weekly
:css
body, td { color:#000000; font-size:14px; font-family:Verdana,Helvetica,Arial; }
.divider { background-color:#555555; height:2px; }
.episode h2 { margin-top:0; margin-bottom:8px; font-size:18px; }
.episode p { margin:8px 0; }
.episode img { border:solid 1px #777777; }
.episode .duration { font-size:11px;color:#555555; }
#footer { font-size:11px; color:#555555; }
#footer a { color:#555555;}
%body
%table#background{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "100%"}
%tr
%td{:align => "center", :valign => "top"}
%table#main{:border => "0", :cellpadding => "0", :cellspacing => "20", :width => "650"}
%tr
%td#header{:colspan => "2"}
%a{:href => "http://railscasts.com/"}
%img{:alt => "RailsCasts", :height => "56", :src => "http://railscasts.com/images/railscasts_logo.png", :width => "423"}/
%tr
%td.divider{:bgcolor => "#555555", :colspan => "2", :height => "2"}
%tr.episode
%td
%a{:href => "#"}
%img{:alt => "#310 Getting Started with Rails", :height => "125", :src => "http://railscasts.com/assets/episodes/stills/310-getting-started-with-rails.png", :width => "200"}/
%td{:valign => "top"}
%h2 #310 Getting Started with Rails
%p Learning Ruby on Rails can be overwhelming, especially if you are new to programming. Here I will take you on a tour through various resources to help get started with Rails.
%p
%a{:href => "#"} Watch Episode
%span.duration (7 minutes)
%tr
%td.divider{:bgcolor => "#555555", :colspan => "2", :height => "2"}
%tr
%td#footer{:align => "center", :colspan => "2"}
%p
%a{:href => "#"} Unsubscribe
if you do not wish to receive these emails in the future.
%p ©2011 RailsCasts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment