Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions kcidb/monitor/subscriptions/incident_notification.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""Incident notifications"""

from kcidb.monitor.output import NotificationMessage as Message


def match_incident(incident):
"""Send notification upon incident creation"""

print(f"Generating notification for {incident.id}")
# if not incident.issue.subsriber:
# return ()

# static subscriber for testing
subscriber = "Jeny Sadadia <[email protected]>"

return (Message(
subject='Incident notification for {% include "incident_summary.txt.j2" %}',
to=[subscriber],
body='{% include "incident_description.txt.j2" %}',
),)