forked from basecamp/mail_view
/
email.html.erb
88 lines (76 loc) · 1.72 KB
/
email.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<%= body_part.charset %>" />
</head>
<style type="text/css">
#message_headers {
position: absolute;
top: 0px;
left: 0;
width: 100%;
height: 85px;
padding: 10px 0 0 0;
margin: 0;
background: #fff;
font-size: 12px;
font-family: "Lucida Grande";
border-bottom: 1px solid #dedede;
overflow: hidden;
}
#message_headers dl {
margin: 0;
padding: 0;
}
#message_headers dt {
width: 60px;
padding: 1px;
float: left;
text-align: right;
font-weight: bold;
color: #7f7f7f;
}
#message_headers dd {
margin-left: 70px;
padding: 1px;
}
#message_headers p.alternate {
position: absolute;
top: 0;
right: 15px;
}
#message_headers p.alternate a {
color: #09c;
}
pre#message_body {
padding: 10px;
white-space: pre-wrap;
}
body {
margin-top: 96px !important;
}
</style>
<div id="message_headers">
<dl>
<dt>From:</dt>
<dd><%= mail.from %></dd>
<dt>Subject:</dt>
<dd><strong><%= mail.subject %></strong></dd>
<dt>Date:</dt>
<dd><%= Time.now.strftime("%b %e, %Y %I:%M:%S %p %Z") %></dd>
<dt>To:</dt>
<dd><%= mail.to %></dd>
</dl>
<% if mail.multipart? %>
<p class="alternate">
<% if body_part.content_type && body_part.content_type.match(/text\/html/) %>
<a href="<%= name %>.txt">View plain text version</a>
<% else %>
<a href="<%= name %>.html">View HTML version</a>
<% end %>
</p>
<% end %>
</div>
<% if body_part.content_type && body_part.content_type.match(/text\/html/) %>
<%= body_part.body %>
<% else %>
<pre id="message_body"><%= body_part.body %></pre>
<% end %>