/
user_mailer.html.erb
51 lines (51 loc) · 2.65 KB
/
user_mailer.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<html lang="<%= I18n.locale %>" dir="<%= I18n.t("html.dir") %>">
<head>
<meta charset="UTF-8"></meta>
</head>
<body style="direction: <%= I18n.t("html.dir") %>; padding: 0; margin: 0; font-size: 14px; font-family: 'Helvetica Neue', Arial, sans-serif; color: #222">
<table style="background-color: #eee; width: 100%">
<tr>
<%# having width=100% on the table and then only a fixed width on the middle cell gives us a max-width that works in Outlook %>
<td rowspan="2"></td>
<td width="600" style="text-align: center; padding: 0px 7px">
<table style="width: 100%; color: #222; margin-<%= style_left %>: auto; margin-<%= style_right %>: auto">
<tr>
<td style="width: 30px; padding-top: 10px; padding-<%= style_right %>: 10px; padding-bottom: 10px; padding-<%= style_left %>: 0px">
<a href="<%= @root_url %>" target="_blank">
<%= image_tag attachments["logo.png"].url, :alt => "OpenStreetMap", :title => "OpenStreetMap", :height => "30", :width => "30", :border => "0" %>
</a>
</td>
<%# the "width: 100%" here looks wrong, but I couldn't find a better way of making Outlook give this cell full width %>
<td style="width: 100%; padding: 0px; text-align: <%= style_left %>">
<%# NB we need "text-decoration: none" twice: GMail only honours it on the <a> but Outlook only on the <strong> %>
<a href="<%= @root_url %>" target="_blank" style="text-decoration: none; color: #000">
<strong style="text-decoration: none; font-size: 18px; font-weight: 600; margin: 0; text-align: <%= style_left %>; font-family: 'Helvetica Neue', Arial, sans-serif">OpenStreetMap</strong>
</a>
</td>
</tr>
<tr>
<td colspan="2">
<table style="background-color: #fff; color: #222; border: solid 1px #ccc; border-collapse: separate">
<tr>
<td style="text-align: <%= style_left %>; padding: 0px 15px 5px 15px">
<%= raw style_message(yield) %>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td rowspan="2"></td>
</tr>
<tr>
<td style="text-align: center; font-size: 11px; font-family: 'Helvetica Neue', Arial, sans-serif">
<%= yield :footer %>
<p style="margin-bottom: 10px">
<a href="<%= @root_url %>" target="_blank" style="color: #222">OpenStreetMap</a>
</p>
</td>
</tr>
</table>
</body>
</html>