app/views/digest_mailer/digest_mailer.html.erb
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
</head>
<body style="margin: 0 !important; padding: 0 !important;">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center">
<table width="100%" style="max-width: 646px;" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<%= image_tag "http://www.rubygamedev.com/email/header_#{ @history.frequency }.png", style: "width: 646px; height: 324px;" %>
</td>
</tr>
<tr>
<td>
<h1 style="font-family: HelveticaNeue-Bold; font-size: 21px; color: red; line-height: 26px; margin-left: 20px;"> Recent Posts </h1><br>
<% if @posts.empty? %>
<h1 style="font-family: HelveticaNeue-Bold; font-size: 21px; color:#331A48; line-height: 26px; margin-left: 20px;">
No new posts
</h1>
<p>
No new posts have been added since the last email. <%= link_to "Click here to add a post to RubyGameDev.com", new_post_url %>
</p>
<% else %>
<% @posts.each do |post| %>
<h1 style="font-family: HelveticaNeue-Bold; font-size: 21px; color: #331A48; line-height: 26px; margin-left: 20px;">
<%= post.title %>
</h1>
<div style="font-family: HelveticaNeue; font-size: 20px;color: #6E4995; line-height: 18px; padding: 15px;">
<p>
<%= pluralize(post.number_of_comments, "comment") %>,
<%= pluralize(post.votes.count,"vote") %> , created at <%= post.created_at.strftime('%Y-%m-%d') %>
</p>
</div>
<% end %>
<% end %>
</td>
</tr>
<tr>
<td style="padding: 20px 0;">
<%= image_tag "http://www.rubygamedev.com/email/footer.png", style: "width: 646px; height: 229px;" %>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>