Use email logo as subtle watermark instead of standalone image
Mirror and run GitLab CI / build (push) Has been cancelled
Ruff / ruff (push) Has been cancelled

This commit is contained in:
admin
2026-06-14 16:02:56 +00:00
parent 1dea51f1f9
commit 2dce9b43c9
4 changed files with 9 additions and 8 deletions
+6 -5
View File
@@ -66,12 +66,12 @@ def _load_css(path: str) -> str:
def _email_logo_html() -> str:
"""
Return logo HTML for emails.
Return a subtle watermark-style logo for emails.
- Priority:
1) EMAIL_LOGO_URL (direct URL)
2) EMAIL_LOGO_PATH (local file as base64)
- Size: max 200% of line height (small).
- Style: small, faint, bottom-right, non-intrusive.
"""
logo_url = os.getenv("EMAIL_LOGO_URL")
src = logo_url
@@ -89,10 +89,11 @@ def _email_logo_html() -> str:
if not src:
return ""
# max-height limited to 200% of line height (approx 2em)
# Watermark: bottom-right, low opacity, compact
return (
f'<img src="{src}" alt="Logo" '
f'style="max-height:2em; width:auto; display:block; margin:0 auto 0.5em auto;" />'
f'<div style="text-align: right; margin-top: 24px; opacity: 0.15;">'
f'<img src="{src}" alt="Logo" style="max-width: 90px; height: auto; display: inline-block;" />'
f'</div>'
)