-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplates.go
96 lines (89 loc) · 1.9 KB
/
templates.go
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
89
90
91
92
93
94
95
96
package gomailify
// HTMLTemplate taken from react-email package.
// Combines both HTML and Head template
const HTMLTemplate = `
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" lang="en">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<meta name="x-apple-disable-message-reformatting" />
</head>
{{ .Value }}
{{ range .Children }}
{{ . }}
{{ end }}
</html>
`
// ContainerTemplate taken from rendered react-email package.
const ContainerTemplate = `
<table
align="center"
width="100%"
border="0"
cellpadding="0"
cellspacing="0"
role="presentation"
style="max-width:37.5em"
>
<tbody>
<tr style="width: 100%;">
<td>
{{ .Value }}
{{ range .Children }}
{{ . }}
{{ end }}
</td>
</tr>
</tbody>
</table>
`
// ParagraphTemplate taken from rendered react-email package.
const ParagraphTemplate = `
<p style="font-size:14px;line-height:24px;margin:16px 0">
{{ .Value }}
{{ range .Children }}
{{ . }}
{{ end }}
</p>
`
const CodeBlockTemplate = `
<table
align="center"
width="100%"
border="0"
cellpadding="0"
cellspacing="0"
role="presentation"
style="max-width:37.5em"
>
<tbody>
<tr style="width: 100%;">
<td style="font-family:monospace,'Courier New',Consolas,Courier,Monaco,'Andale Mono','Ubuntu Mono';">
{{ .Value }}
{{ range .Children }}
{{ . }}
{{ end }}
</td>
</tr>
</tbody>
</table>
`
const TextTemplate = `
{{ .Value }}
{{ range .Children }}
{{ . }}
{{ end }}
`
const InlineCodeTemplate = `
<style>
meta ~ .cino {
display: none !important;
opacity: 0 !important;
}
meta ~ .cio {
display: block !important;
}
</style>
<code class="cino">{{ . }}</code>
<span class="cio" style="display: none">{{ . }}</span>
`