Helpers
A clever way to add consistent vertical spacing in emails.
The spacer helper adds vertical space between elements in email templates using tables, since margins and padding can be unreliable across email clients.
Instead of writing HTML tables manually, use this helper to add consistent spacing.
Specify the spacing amount in vertical pixels to control the gap size.
<!-- compiled output -->
<p>Some text...</p>
<table class="spacer">
<tbody>
<tr>
<td height="16" style="font-size:16px;line-height:16px;"> </td>
</tr>
</tbody>
</table>
<p>Another paragraph</p>
<p>Some text....</p>
<%= spacer(16) %>
<p>Another paragraph</p>