This is about the same amount of code than the previous approach, but has the following advantages: * Uses Roda's render plugin, so templates are cached and optimized into compiled methods. The previous approach created 5 separate Tilt::ErubiTemplate objects for every email rendered. The new approach does not create any Tilt::ErubiTemplate objects after the first email. * Uses part instead of render for simpler rendering with locals. * Moves EmailRenderer to separate file, so that reloading works correctly. * Skips the rendering of the email stylesheet, since it does not contain any ERB code. Instead, the file is included without rendering. * Uses fixed locals for the email templates, so providing an invalid local will result in an error. * Removes unnecessary empty `<style>` tag in email layout. The only spec change is adding an email to one of the invoice specs. I'm not sure why this didn't fail before, but the mail library complains if it tries to deliver a email with no recipients.
24 lines
574 B
Plaintext
24 lines
574 B
Plaintext
<% require "date" %>
|
|
<tr>
|
|
<td>
|
|
<table class="footer" align="center" width="570" cellpadding="0" cellspacing="0" role="presentation">
|
|
<tr>
|
|
<td align="left">
|
|
<p>
|
|
©
|
|
<%= Date.today.year %>
|
|
Ubicloud. All rights reserved.
|
|
</p>
|
|
</td>
|
|
<td align="right">
|
|
<a href="https://github.com/ubicloud/ubicloud" class="icon">
|
|
<%== part("components/icon", name: "github", classes: "") %>
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|