Skip to content

Commit 16b6968

Browse files
Merge pull request #110 from goldlabelapps/staging
Bump version; update CORS origins and email template
2 parents db634e7 + 2a95d9c commit 16b6968

3 files changed

Lines changed: 38 additions & 41 deletions

File tree

app/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""Python° - FastAPI, Postgres, tsvector"""
22

33
# Current Version
4-
__version__ = "3.1.1"
4+
__version__ = "3.1.2"
55

app/main.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,16 @@
2020
CORSMiddleware,
2121
allow_origins=[
2222
"http://localhost:1999",
23+
"http://localhost:1980",
2324
"http://localhost:2027",
2425
"http://localhost:2020",
2526
"http://localhost:2000",
2627
"https://goldlabel.pro",
2728
"https://nx-admin.goldlabel.pro",
2829
"https://free.goldlabel.pro",
29-
"https://listingslab.com/",
30-
"https://ed-tech.co/",
31-
"https://notheretofuckspiders.art/",
30+
"https://listingslab.com",
31+
"https://ed-tech.co",
32+
"https://notheretofuckspiders.art",
3233
],
3334
allow_credentials=True,
3435
allow_methods=["*"],

app/utils/email_templates/goldlabel.py

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
"""Goldlabel branded HTML email template."""
22

3-
_LOGO_URL = "https://goldlabel.pro/goldlabelpro/png/favicon.png"
4-
_BASE_URL = "https://goldlabel.pro"
5-
6-
# Palette (dark theme used for the email chrome; body text stays readable on white clients)
7-
_DARK_BG = "#364450"
8-
_DARK_PAPER = "#364450"
9-
_DARK_PRIMARY = "#ffd849"
10-
_DARK_TEXT = "#ffffff"
3+
_LOGO_URL = "https://goldlabel.pro/shared/png/virus/virus.png"
4+
_BASE_URL = "https://goldlabel.pro/virus"
5+
6+
# Palette (light theme only - light backgrounds with dark text)
7+
_LIGHT_BG = "#ffffff"
118
_LIGHT_PAPER = "#ffffff"
12-
_LIGHT_TEXT = "#000000"
13-
_LIGHT_PRIMARY = "#364450"
9+
_ACCENT_COLOR = "#ffd849"
10+
_DARK_TEXT = "#000000"
11+
_LIGHT_TEXT = "#666666"
12+
_SECONDARY_BG = "#FFFFFF"
1413

1514

1615
def goldlabel_email(
@@ -47,21 +46,19 @@ def goldlabel_email(
4746
/* ── Base ──────────────────────────────────────── */
4847
body {{
4948
margin: 0; padding: 0;
50-
background-color: #ffffff;
49+
background-color: {_LIGHT_BG};
5150
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
52-
color: {_LIGHT_TEXT};
51+
color: {_DARK_TEXT};
5352
}}
5453
55-
/* ── Dark-mode overrides ───────────────────────── */
56-
@media (prefers-color-scheme: dark) {{
57-
body, .email-wrapper {{ background-color: #ffffff !important; color: {_DARK_TEXT} !important; }}
58-
.email-card {{ background-color: {_DARK_PAPER} !important; color: {_DARK_TEXT} !important; }}
59-
.email-header-inner {{ background-color: {_DARK_BG} !important; }}
60-
.email-footer {{ background-color: {_DARK_BG} !important; color: {_DARK_TEXT} !important; }}
61-
.email-subject {{ color: {_DARK_PRIMARY} !important; }}
62-
.email-cta {{ background-color: {_DARK_PRIMARY} !important; color: {_LIGHT_PRIMARY} !important; }}
63-
a {{ color: {_DARK_PRIMARY} !important; }}
64-
}}
54+
/* ── Light theme only ──────────────────────── */
55+
.email-wrapper {{ background-color: {_LIGHT_BG}; }}
56+
.email-card {{ background-color: {_LIGHT_PAPER}; color: {_DARK_TEXT}; }}
57+
.email-header-inner {{ background-color: {_SECONDARY_BG}; }}
58+
.email-footer {{ background-color: {_SECONDARY_BG}; color: {_LIGHT_TEXT}; }}
59+
.email-subject {{ color: {_DARK_TEXT}; }}
60+
.email-cta {{ background-color: {_DARK_TEXT}; color: #ffffff; }}
61+
a {{ color: {_DARK_TEXT}; text-decoration: underline; }}
6562
</style>
6663
</head>
6764
<body class="email-wrapper">
@@ -79,23 +76,21 @@ def goldlabel_email(
7976
8077
<!-- Header -->
8178
<tr>
82-
<td class="email-header" align="left"
79+
<td class="email-header" align="center"
8380
style="padding:24px 40px 0 40px;">
8481
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" class="email-header-inner"
85-
style="background-color:{_LIGHT_PRIMARY}; border-radius:6px;">
82+
style="background-color:{_SECONDARY_BG}; border-radius:6px; max-width:300px; margin:0 auto;">
8683
<tr>
87-
<td align="left" valign="middle" style="padding:20px 16px 20px 20px; width:1%; white-space:nowrap;">
84+
<td align="center" valign="middle" style="padding:20px;">
8885
<a href="{_BASE_URL}" style="text-decoration:none; display:inline-block;">
8986
<img src="{_LOGO_URL}"
9087
width="48" height="48"
91-
alt="Goldlabel"
92-
style="width:48px; height:48px; border-radius:6px;" />
88+
alt="Virus°"
89+
style="width:48px; height:48px; border-radius:6px; display:block; margin:0 auto 10px auto;" />
9390
</a>
94-
</td>
95-
<td align="left" valign="middle" style="padding:20px 20px 20px 0;">
9691
<h1 class="email-subject"
9792
style="margin:0; font-size:22px; font-weight:700;
98-
color:#ffffff; line-height:1.3;">
93+
color:{_DARK_TEXT}; line-height:1.3;">
9994
{subject}
10095
</h1>
10196
</td>
@@ -108,21 +103,21 @@ def goldlabel_email(
108103
<tr>
109104
<td align="left"
110105
style="padding: 30px 40px 24px 40px;
111-
font-size:15px; line-height:1.7; color:{_LIGHT_TEXT};">
106+
font-size:15px; line-height:1.7; color:{_DARK_TEXT};">
112107
{body_html}
113108
</td>
114109
</tr>
115110
116111
<!-- CTA -->
117112
<tr>
118-
<td align="left" style="padding: 0 40px 28px 40px;">
113+
<td align="center" style="padding: 0 40px 28px 40px;">
119114
<a class="email-cta"
120115
href="{cta_url}"
121-
style="display:block; width:100%; box-sizing:border-box;
122-
background-color:{_DARK_PRIMARY}; color:{_LIGHT_PRIMARY};
116+
style="display:inline-block;
117+
background-color:{_DARK_TEXT}; color:#ffffff;
123118
font-size:16px; font-weight:700; text-align:center;
124119
text-decoration:none; border-radius:6px;
125-
padding:14px 20px;">
120+
padding:14px 28px;">
126121
{cta_label}
127122
</a>
128123
</td>
@@ -133,9 +128,10 @@ def goldlabel_email(
133128
<tr>
134129
<td class="email-footer" align="center"
135130
style="padding: 20px 40px;
136-
font-size:12px; color:#666666;">
131+
font-size:12px; color:{_LIGHT_TEXT};
132+
background-color:{_SECONDARY_BG};">
137133
<a href="https://github.com/goldlabelapps/python"
138-
style="color:{_LIGHT_PRIMARY}; text-decoration:none;">
134+
style="color:{_DARK_TEXT}; text-decoration:none;">
139135
Sent with Python°
140136
</a>
141137

0 commit comments

Comments
 (0)