feat: Add notification service with Apprise integration for email, Discord, and Mattermost channels.

This commit is contained in:
Michael committed 2025-11-23 23:47:45 +01:00
1 parent f720a7aa17
commit 18d5f3dbf1
1 file changed
+7 -4
+7 -4
View File
@@ -64,8 +64,8 @@ class NotificationService:
if not webhook_url:
return None
# If it's already a mattermost:// URL, return it
if webhook_url.startswith("mattermost://"):
# If it's already a mmost:// or mmosts:// URL, return it
if webhook_url.startswith("mmost://") or webhook_url.startswith("mmosts://"):
return webhook_url
# Parse standard webhook URL: https://mattermost.example.com/hooks/TOKEN
@@ -76,8 +76,11 @@ class NotificationService:
token = path_parts[-1]
host = parsed.netloc
# Apprise format: mattermost://host/token
return f"mattermost://{host}/{token}"
# Determine scheme based on original URL
scheme = "mmosts" if parsed.scheme == "https" else "mmost"
# Apprise format: mmosts://host/token (without /hooks/)
return f"{scheme}://{host}/{token}"
except Exception:
return webhook_url