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
+1 -1
View File
@@ -10,7 +10,6 @@
</head> </head>
<body> <body>
<div class="container"> <div class="container">
{email_logo}
<h1 style="color:{accent_color};">Error Notification</h1> <h1 style="color:{accent_color};">Error Notification</h1>
<p>Dear user,</p> <p>Dear user,</p>
<p>An error occurred while processing your audio file. This means that something went wrong during the processing of your file, and it could not be completed successfully.</p> <p>An error occurred while processing your audio file. This means that something went wrong during the processing of your file, and it could not be completed successfully.</p>
@@ -26,6 +25,7 @@
<p>Thank you for using our transcription service!</p> <p>Thank you for using our transcription service!</p>
<p>A.P.Strom</p> <p>A.P.Strom</p>
</div> </div>
{email_logo}
</div> </div>
</body> </body>
</html> </html>
+1 -1
View File
@@ -10,7 +10,6 @@
</head> </head>
<body> <body>
<div class="container"> <div class="container">
{email_logo}
<h1 style="color:{accent_color};">Transcript Ready</h1> <h1 style="color:{accent_color};">Transcript Ready</h1>
<p>Dear user,</p> <p>Dear user,</p>
<p>Your file has been successfully processed, and the transcript is now ready. The transcript of your audio or video file is attached to this email.</p> <p>Your file has been successfully processed, and the transcript is now ready. The transcript of your audio or video file is attached to this email.</p>
@@ -25,6 +24,7 @@
<p>Thank you for using our transcription service!</p> <p>Thank you for using our transcription service!</p>
<p>A.P.Strom</p> <p>A.P.Strom</p>
</div> </div>
{email_logo}
</div> </div>
</body> </body>
</html> </html>
+1 -1
View File
@@ -10,7 +10,6 @@
</head> </head>
<body> <body>
<div class="container"> <div class="container">
{email_logo}
<h1 style="color:{accent_color};">Upload Successful</h1> <h1 style="color:{accent_color};">Upload Successful</h1>
<p>Dear user,</p> <p>Dear user,</p>
<p>Your file has been successfully uploaded and is now in our processing queue. This means that our system has received your file, and it is waiting to be processed. We will handle your file as soon as possible.</p> <p>Your file has been successfully uploaded and is now in our processing queue. This means that our system has received your file, and it is waiting to be processed. We will handle your file as soon as possible.</p>
@@ -26,6 +25,7 @@
<p>Thank you for using our transcription service!</p> <p>Thank you for using our transcription service!</p>
<p>A.P.Strom</p> <p>A.P.Strom</p>
</div> </div>
{email_logo}
</div> </div>
</body> </body>
</html> </html>
+6 -5
View File
@@ -66,12 +66,12 @@ def _load_css(path: str) -> str:
def _email_logo_html() -> str: def _email_logo_html() -> str:
""" """
Return logo HTML for emails. Return a subtle watermark-style logo for emails.
- Priority: - Priority:
1) EMAIL_LOGO_URL (direct URL) 1) EMAIL_LOGO_URL (direct URL)
2) EMAIL_LOGO_PATH (local file as base64) 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") logo_url = os.getenv("EMAIL_LOGO_URL")
src = logo_url src = logo_url
@@ -89,10 +89,11 @@ def _email_logo_html() -> str:
if not src: if not src:
return "" return ""
# max-height limited to 200% of line height (approx 2em) # Watermark: bottom-right, low opacity, compact
return ( return (
f'<img src="{src}" alt="Logo" ' f'<div style="text-align: right; margin-top: 24px; opacity: 0.15;">'
f'style="max-height:2em; width:auto; display:block; margin:0 auto 0.5em auto;" />' f'<img src="{src}" alt="Logo" style="max-width: 90px; height: auto; display: inline-block;" />'
f'</div>'
) )