-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.go
More file actions
66 lines (64 loc) · 2.91 KB
/
shell.go
File metadata and controls
66 lines (64 loc) · 2.91 KB
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
// Copyright (c) Kopexa GmbH
// SPDX-License-Identifier: BUSL-1.1
package comms
// emailShellTemplate is the HTML email shell template that wraps body content
// with a branded header, footer, and styling. Uses table layout and inline
// styles for maximum email client compatibility (Outlook, Gmail, Yahoo, etc.).
//
// Template data:
// - .Body: rendered body HTML content (pre-rendered, inserted as-is)
// - .Preheader: preview text shown in email client list view
// - .Branding: resolved Branding struct with all color/font/company values
const emailShellTemplate = `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body style="margin: 0; padding: 0; background-color: {{.Branding.BackgroundColor}}; font-family: {{.Branding.FontFamily}}; color: {{.Branding.TextColor}}; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%;">
{{- if .Preheader}}
<div style="display: none; max-height: 0; overflow: hidden;">{{.Preheader}}</div>
<div style="display: none; max-height: 0px; overflow: hidden;">͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ </div>
{{- end}}
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="background-color: {{.Branding.BackgroundColor}};">
<tr>
<td align="center" style="padding: 20px 0;">
<table role="presentation" width="600" cellpadding="0" cellspacing="0" border="0" style="max-width: 600px; width: 100%;">
<!-- Header -->
<tr>
<td align="center" style="padding: 20px 40px; border-bottom: 3px solid {{.Branding.PrimaryColor}};">
{{- if .Branding.LogoURL}}
<img src="{{.Branding.LogoURL}}" alt="{{.Branding.BrandName}}" style="max-height: 40px; width: auto;" />
{{- else}}
<span style="font-size: 24px; font-weight: bold; color: {{.Branding.PrimaryColor}}; font-family: {{.Branding.FontFamily}};">{{.Branding.BrandName}}</span>
{{- end}}
</td>
</tr>
<!-- Content -->
<tr>
<td style="background-color: #ffffff; padding: 40px 48px;">
{{.Body}}
</td>
</tr>
<!-- Footer -->
<tr>
<td style="padding: 20px 40px;">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="border-top: 1px solid #e2e8f0; padding-top: 20px; font-size: 12px; color: #64748b; line-height: 1.5;">
<p style="margin: 0 0 8px 0;">If you have any questions, contact us at <a href="mailto:{{.Branding.SupportEmail}}" style="color: {{.Branding.LinkColor}};">{{.Branding.SupportEmail}}</a>.</p>
<p style="margin: 0 0 8px 0;">{{.Branding.CompanyName}}</p>
{{- if .Branding.CompanyAddress}}
<p style="margin: 0; white-space: pre-line;">{{.Branding.CompanyAddress}}</p>
{{- end}}
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>`