10
10
style ( type ='text/css' ) .
11
11
body {
12
12
font-family : arial , sans-serif ;
13
- }
14
- h1 {
15
- font-size : 18px ;
16
- padding : 10px ;
17
- font-weight : normal ;
13
+ padding-left : 20px ;
14
+ padding-right : 20px ;
18
15
}
19
16
table {
20
17
padding-left : 10px ;
31
28
padding : 6px 16px 6px 0
32
29
}
33
30
iframe {
34
- margin : 0 auto ;
35
31
border : 0 ;
36
32
height : 100% ;
37
33
width : 100% ;
@@ -40,129 +36,31 @@ html
40
36
display : block ;
41
37
border : 1px solid black ;
42
38
}
43
- p {
44
- text-align : center ;
45
- }
46
39
47
40
body
48
-
49
- if subject
50
- h1= subject
51
- hr
52
- table
53
- if from
54
- tr
55
- th from
56
- td= ` ${ from .name } <${ from .address } >` .trim ()
57
- if to
58
- tr
59
- th to
60
- td
61
- if Array .isArray (to)
62
- each t, ti in to
63
- = ` ${ t .name } <${ t .address } >` .trim ()
64
- if to .length - 1 !== ti
65
- = ' , '
66
- else
67
- = ` ${ to .name } <${ to .address } >` .trim ()
68
- if cc
69
- tr
70
- th cc
71
- td
72
- if Array .isArray (cc)
73
- each c, ci in cc
74
- = ` ${ c .name } <${ c .address } >` .trim ()
75
- if cc .length - 1 !== ci
76
- = ' , '
77
- else
78
- = ` ${ cc .name } <${ cc .address } >` .trim ()
79
- if bcc
80
- tr
81
- th bcc
82
- td
83
- if Array .isArray (bcc)
84
- each bc, bci in bcc
85
- = ` ${ bc .name } <${ bc .address } >` .trim ()
86
- if bcc .length - 1 !== bci
87
- = ' , '
88
- else
89
- = ` ${ bcc .name } <${ bcc .address } >` .trim ()
90
- if subject
91
- tr
92
- th subject
93
- td: strong= subject
94
- if attachments && attachments .length > 0
95
- tr
96
- th attachments
97
- td
98
- ul
99
- each a in attachments
100
- li
101
- a( href =` data:${ a .contentType }${ a .encoding ? ` ;${ a .encoding } ` : ' ' } ,${ a .content } ` , download =a .filename , target ='_blank' )
102
- if a .filename
103
- = ` ${ a .filename } `
104
- else
105
- = ' Unnamed file'
106
- if sender
107
- tr
108
- th sender
109
- td= sender
110
- if replyTo
111
- tr
112
- th replyTo
113
- td
114
- if Array .isArray (replyTo)
115
- each t, ti in replyTo
116
- = ` ${ t .name } <${ t .address } >` .trim ()
117
- if to .length - 1 !== ti
118
- = ' , '
119
- else
120
- = ` ${ replyTo .name } <${ replyTo .address } >` .trim ()
121
- if inReplyTo
122
- tr
123
- th inReplyTo
124
- td= inReplyTo
125
- if references
126
- tr
127
- th references
128
- if Array .isArray (references)
129
- td= references .join (' , ' )
130
- else
131
- td= references
132
- if messageId
133
- tr
134
- th messageId
135
- td= messageId
136
- if ! date
137
- - date = new Date ()
138
- tr
139
- th date
140
- td= dayjs (date).format (' ddd, MMM D, YYYY' ) + ' at ' + dayjs (date).format (' h:mm A' )
141
- if headers && typeof headers === ' object' && Object .keys (headers).length > 0
142
- tr
143
- th headers
144
- td
145
- each header, hi in Object .keys (headers)
146
- strong= ` ${ header} : `
147
- = headers[header]
148
- if Object .keys (headers).length - 1 !== hi
149
- = ' , '
150
- if list && typeof list === ' object' && Object .keys (list).length > 0
151
- tr
152
- th list
153
- td
154
- each key, ki in Object .keys (list)
155
- strong= ` ${ key} : `
156
- if typeof list[key] === ' object'
157
- = list[key].url
41
+ if headers .get (' subject' )
42
+ p: strong Subject:
43
+ p= headers .get (' subject' )
44
+ p: strong Headers:
45
+ pre
46
+ code
47
+ each headerLine, i in headerLines
48
+ = headerLine .line
49
+ if i < headerLines .length - 1
50
+ br
51
+ if attachments && attachments .length > 0
52
+ p: strong Attachments:
53
+ ul
54
+ each a in attachments
55
+ li
56
+ a( href =` data:${ a .contentType } ;base64,${ a .content .toString (' base64' )} ` , download =a .filename , target ='_blank' )
57
+ if a .filename
58
+ = ` ${ a .filename } `
158
59
else
159
- = list[key]
160
- if Object .keys (list).length - 1 !== ki
161
- = ' , '
162
- hr
60
+ = ' Unnamed file'
163
61
if html
164
- iframe( seamless ='seamless' , srcdoc =` <base target='_top'>${ html} ` )
62
+ p: strong HTML:
63
+ p: iframe( seamless ='seamless' , srcdoc =` <base target='_top'>${ html} ` )
165
64
if text
166
- hr
167
- p: small TEXT VERSION:
168
- iframe( seamless ='seamless' , srcdoc =` <pre>${ text} </pre>` )
65
+ p: strong TEXT:
66
+ p: iframe( seamless ='seamless' , srcdoc =` <pre>${ text} </pre>` )
0 commit comments