Skip to content

Commit a994130

Browse files
CryptoJonesclaude
andauthored
fix(api): force dark email with color-scheme meta (iOS/Apple Mail + Gmail) (#38)
Confirmed from an iOS Mail screenshot: the cyberdeck email rendered white because the client normalized it to the device's LIGHT appearance — the email never declared itself dark. Send a full HTML document (not a bare <body> fragment) with <meta name="color-scheme" content="dark"> + supported-color-schemes, plus color-scheme:dark on the body. That tells iOS/Apple Mail and Gmail to render dark regardless of the device setting. Keeps the table bgcolor dark canvas underneath. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent d173dce commit a994130

3 files changed

Lines changed: 21 additions & 10 deletions

File tree

api/ApplyTrack.Api/ApplyTrack.Api.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<RootNamespace>ApplyTrack.Api</RootNamespace>
8-
<Version>1.7.2</Version>
8+
<Version>1.7.3</Version>
99
<Authors>Aaron K. Clark</Authors>
1010
<Copyright>Copyright 2026 Aaron K. Clark</Copyright>
1111
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>

api/ApplyTrack.Api/Auth/SmtpEmailSender.cs

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,31 @@ public async Task SendMagicLinkAsync(string email, string link)
3535
$"Sign in to OSApplyTrack:\n\n{link}\n\n"
3636
+ "This link is single-use and expires in 15 minutes. "
3737
+ "If you didn't request it, you can ignore this email.",
38-
// Cyberdeck theme (CryptoJones/cyberdeck-theme), matching the mobile site:
39-
// cyan-on-near-black, monospace. The dark canvas lives on a full-width
40-
// <table> with a bgcolor ATTRIBUTE — Gmail strips <body> + its background,
41-
// so a body-only color leaves a white page. Solid hex borders (no rgba —
42-
// some clients drop it), inline styles only, no remote images, mono via
43-
// system fonts (Menlo/Consolas) since email can't load the vendored one.
38+
// Cyberdeck theme (CryptoJones/cyberdeck-theme), matching the mobile site.
39+
// A full HTML document with color-scheme:dark + supported-color-schemes:dark
40+
// is REQUIRED: without it, iOS/Apple Mail (and Gmail) normalize the email to
41+
// the device's LIGHT appearance — forcing a white background and darkening
42+
// the light text (which is what made earlier versions render white). The dark
43+
// canvas sits on a full-width <table> with a bgcolor attribute (clients strip
44+
// <body> backgrounds); solid hex borders (no rgba); inline styles only; no
45+
// remote images; mono via system fonts since email can't load the vendored one.
4446
HtmlBody =
4547
$$"""
46-
<body style="margin:0;padding:0;background-color:#07090f;">
48+
<!DOCTYPE html>
49+
<html lang="en">
50+
<head>
51+
<meta charset="utf-8">
52+
<meta name="viewport" content="width=device-width, initial-scale=1">
53+
<meta name="color-scheme" content="dark">
54+
<meta name="supported-color-schemes" content="dark">
55+
</head>
56+
<body style="margin:0;padding:0;background-color:#07090f;color-scheme:dark;">
4757
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#07090f" style="background-color:#07090f;width:100%;margin:0;">
4858
<tr>
4959
<td align="center" bgcolor="#07090f" style="background-color:#07090f;padding:32px 16px;font-family:Menlo,Consolas,'DejaVu Sans Mono',monospace;">
5060
<table role="presentation" width="460" cellpadding="0" cellspacing="0" border="0" style="width:100%;max-width:460px;text-align:left;">
5161
<tr><td style="padding:0 0 22px;font-size:26px;font-weight:800;letter-spacing:-0.01em;color:#cfd8e3;">
52-
<span style="color:#27d4ff;text-shadow:0 0 12px rgba(39,212,255,0.6);">apply</span>track
62+
<span style="color:#27d4ff;">apply</span>track
5363
</td></tr>
5464
<tr><td bgcolor="#0c121c" style="background-color:#0c121c;border:1px solid #1c5566;border-radius:10px;padding:26px;">
5565
<div style="font-size:18px;font-weight:700;color:#cfd8e3;padding:0 0 12px;">Sign in to OSApplyTrack</div>
@@ -64,6 +74,7 @@ public async Task SendMagicLinkAsync(string email, string link)
6474
</tr>
6575
</table>
6676
</body>
77+
</html>
6778
""",
6879
}.ToMessageBody();
6980

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "applytrack-poller"
7-
version = "1.7.2"
7+
version = "1.7.3"
88
description = "Discovery poller for OSApplyTrack — fetches and scores remote job leads into shared Postgres."
99
requires-python = ">=3.10"
1010
license = { text = "Apache-2.0" }

0 commit comments

Comments
 (0)