From 4603aa33ed6b65867905bccc806843d74938e013 Mon Sep 17 00:00:00 2001 From: jedi Date: Fri, 26 Apr 2024 15:56:15 +0200 Subject: [PATCH] stash --- core/mail/notifications.py | 2 +- core/mail/protocol.py | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/mail/notifications.py b/core/mail/notifications.py index 26b0b36..a279873 100644 --- a/core/mail/notifications.py +++ b/core/mail/notifications.py @@ -57,7 +57,7 @@ class NotificationDispatcher: for target in targets: if target.channel_type == 'telegram': await telegram_notify(message, target.channel_target) - if target.channel_type == 'mail': + elif target.channel_type == 'email': print("Sending mail to:", target.channel_target) else: print("Unknown channel type:", target.channel_type) diff --git a/core/mail/protocol.py b/core/mail/protocol.py index 93ea9f0..8e790e4 100644 --- a/core/mail/protocol.py +++ b/core/mail/protocol.py @@ -250,10 +250,14 @@ Your c3lf (Cloakroom + Lost&Found) Team'''.format(active_issue_thread.short_uuid active_issue_thread.save() notification = None - if new: - notification = f"New issue {active_issue_thread.short_uuid()} created by {sender}" + if len(active_issue_thread.name) > 50: + notify_subject = active_issue_thread.name[:47] + "..." else: - notification = f"Reply to issue {active_issue_thread.short_uuid()} by {sender}" + notify_subject = active_issue_thread.name + if new: + notification = f"New issue \"{active_issue_thread.name}\" [{active_issue_thread.short_uuid()}] created by {sender}" + else: + notification = f"Reply to issue \"{active_issue_thread.name}\" [{active_issue_thread.short_uuid()}] by {sender}" return email, new, reply, notification