diff --git a/src/agents/orchestrator.py b/src/agents/orchestrator.py index 7c58429..cc968e1 100644 --- a/src/agents/orchestrator.py +++ b/src/agents/orchestrator.py @@ -320,7 +320,8 @@ async def _create_notifications_for_incident( async def _send_email_notifications_for_incident( db, incident_id: int, incident_title: str, visibility: str, - created_by: int, tenant_id: int, notifications: list[dict] + created_by: int, tenant_id: int, notifications: list[dict], + incident_type: str = "adhoc", ): """Sendet E-Mail-Benachrichtigungen basierend auf individuellen Nutzer-Abos. @@ -378,6 +379,7 @@ async def _send_email_notifications_for_incident( incident_title=incident_title, notifications=filtered_notifications, dashboard_url=dashboard_url, + incident_type=incident_type, ) try: await send_email(prefs["email"], subject, html) @@ -1342,7 +1344,8 @@ class AgentOrchestrator: ) # E-Mail-Benachrichtigungen versenden await _send_email_notifications_for_incident( - db, incident_id, title, visibility, created_by, tenant_id, db_notifications + db, incident_id, title, visibility, created_by, tenant_id, db_notifications, + incident_type=incident_type, ) # Refresh-Log abschließen (mit Token-Statistiken) diff --git a/src/email_utils/templates.py b/src/email_utils/templates.py index 73238c7..b855a4c 100644 --- a/src/email_utils/templates.py +++ b/src/email_utils/templates.py @@ -38,6 +38,7 @@ def incident_notification_email( incident_title: str, notifications: list[dict], dashboard_url: str, + incident_type: str = "adhoc", ) -> tuple[str, str]: """Erzeugt Benachrichtigungs-E-Mail für Lagen-Updates. @@ -46,10 +47,14 @@ def incident_notification_email( incident_title: Titel der Lage/Recherche notifications: Liste von {"text": ..., "icon": ...} Dicts dashboard_url: Link zum Dashboard + incident_type: "adhoc" oder "research" Returns: (subject, html_body) """ + is_research = incident_type == "research" + type_label = "Recherche" if is_research else "Lagebild" + type_label_lower = "Recherche" if is_research else "Lage" subject = f"AegisSight - {incident_title}" icon_map = { @@ -82,10 +87,10 @@ def incident_notification_email(

AegisSight Monitor

-

Lagebericht-Benachrichtigung

+

{type_label} - Benachrichtigung

Hallo {username},

-

es gibt Neuigkeiten zur Lage {incident_title}:

+

es gibt Neuigkeiten zur {type_label_lower} {incident_title}:

{items_html}