From d64447627aa2a9e0e7bf30224c776ae62c76a05d Mon Sep 17 00:00:00 2001 From: Maciej Pienczyn Date: Wed, 11 Mar 2026 17:28:50 +0100 Subject: [PATCH] feat(email): add branded message notification email builder --- email_service.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/email_service.py b/email_service.py index 684b664..8151eb3 100644 --- a/email_service.py +++ b/email_service.py @@ -381,6 +381,41 @@ def _email_v3_wrap(title: str, subtitle: str, content_html: str) -> str: ''' +def build_message_notification_email(sender_name: str, subject: str, content_preview: str, message_url: str, settings_url: str) -> tuple: + """Build branded email for message notification. Returns (html, text).""" + subject_html = f'

Temat: {subject}

' if subject else '' + + content_html = f''' +

+ {sender_name} wysłał(a) Ci wiadomość na portalu Norda Biznes. +

+ + {subject_html} + + + +
+

{content_preview}

+
+ + + +
+ Przeczytaj wiadomość +
+ +

+ Możesz wyłączyć powiadomienia e-mail w ustawieniach prywatności. +

+ ''' + + html = _email_v3_wrap('Nowa wiadomość', f'od {sender_name}', content_html) + + text = f'{sender_name} wysłał(a) Ci wiadomość na portalu Norda Biznes. Odczytaj: {message_url}' + + return html, text + + def send_password_reset_email(email: str, reset_url: str) -> bool: """Send password reset email.""" subject = "Reset hasła - Norda Biznes Partner"