-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgoldlabel.py
More file actions
130 lines (114 loc) · 4.87 KB
/
Copy pathgoldlabel.py
File metadata and controls
130 lines (114 loc) · 4.87 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
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
"""Goldlabel branded HTML email template."""
_LOGO_URL = "https://goldlabel.pro/goldlabelpro/png/favicon.png"
# Palette (dark theme used for the email chrome; body text stays readable on white clients)
_DARK_BG = "#364450"
_DARK_PAPER = "#364450"
_DARK_PRIMARY = "#ffd849"
_DARK_TEXT = "#ffffff"
_LIGHT_BG = "#eaf0f5"
_LIGHT_PAPER = "#EEF7FF"
_LIGHT_TEXT = "#000000"
_LIGHT_PRIMARY = "#364450"
def goldlabel_email(subject: str, body_html: str) -> str:
"""Return a complete HTML email string with Goldlabel branding.
Args:
subject: Used as the visible heading inside the email.
body_html: Inner HTML content placed in the message body area.
Returns:
A self-contained HTML string ready to pass to send_email_resend().
"""
return f"""<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="color-scheme" content="light dark" />
<meta name="supported-color-schemes" content="light dark" />
<title>{subject}</title>
<style>
/* ── Reset ─────────────────────────────────────── */
body, table, td, a {{ -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }}
table, td {{ mso-table-lspace: 0pt; mso-table-rspace: 0pt; }}
img {{ -ms-interpolation-mode: bicubic; border: 0; outline: none; text-decoration: none; display: block; }}
/* ── Base ──────────────────────────────────────── */
body {{
margin: 0; padding: 0;
background-color: {_LIGHT_BG};
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
color: {_LIGHT_TEXT};
}}
/* ── Dark-mode overrides ───────────────────────── */
@media (prefers-color-scheme: dark) {{
body, .email-wrapper {{ background-color: {_DARK_BG} !important; color: {_DARK_TEXT} !important; }}
.email-card {{ background-color: {_DARK_PAPER} !important; color: {_DARK_TEXT} !important; }}
.email-header {{ background-color: {_DARK_BG} !important; }}
.email-footer {{ background-color: {_DARK_BG} !important; color: {_DARK_TEXT} !important; }}
.email-subject {{ color: {_DARK_PRIMARY} !important; }}
a {{ color: {_DARK_PRIMARY} !important; }}
}}
</style>
</head>
<body class="email-wrapper">
<!-- Outer wrapper -->
<table role="presentation" width="100%" cellpadding="0" cellspacing="0"
style="background-color:{_LIGHT_BG}; padding: 32px 0;">
<tr>
<td align="center">
<!-- Card -->
<table role="presentation" class="email-card" width="600" cellpadding="0" cellspacing="0"
style="max-width:600px; width:100%; background-color:{_LIGHT_PAPER};
border-radius:8px; overflow:hidden;
box-shadow: 0 2px 8px rgba(0,0,0,0.10);">
<!-- Header -->
<tr>
<td class="email-header" align="center"
style="background-color:{_DARK_BG}; padding: 28px 40px;">
<img src="{_LOGO_URL}"
width="48" height="48"
alt="Goldlabel"
style="width:48px; height:48px; border-radius:8px;" />
</td>
</tr>
<!-- Subject banner -->
<tr>
<td align="left"
style="padding: 28px 40px 0 40px;">
<h1 class="email-subject"
style="margin:0; font-size:22px; font-weight:700;
color:{_LIGHT_PRIMARY}; line-height:1.3;">
{subject}
</h1>
</td>
</tr>
<!-- Body -->
<tr>
<td align="left"
style="padding: 20px 40px 32px 40px;
font-size:15px; line-height:1.7; color:{_LIGHT_TEXT};">
{body_html}
</td>
</tr>
<!-- Divider -->
<tr>
<td style="padding: 0 40px;">
<hr style="border:none; border-top:1px solid {_DARK_PRIMARY}; margin:0;" />
</td>
</tr>
<!-- Footer -->
<tr>
<td class="email-footer" align="center"
style="padding: 20px 40px;
font-size:12px; color:#666666;">
<a href="https://goldlabel.pro"
style="color:{_LIGHT_PRIMARY}; text-decoration:none;">goldlabel.pro</a>
·
You received this email because a request was made via the NX° API.
</td>
</tr>
</table>
<!-- /Card -->
</td>
</tr>
</table>
</body>
</html>"""