Use email logo as subtle watermark instead of standalone image
This commit is contained in:
@@ -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>'
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user