diff --git a/kcidb/monitor/subscriptions/incident_notification.py b/kcidb/monitor/subscriptions/incident_notification.py new file mode 100644 index 00000000..fd8f632d --- /dev/null +++ b/kcidb/monitor/subscriptions/incident_notification.py @@ -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 " + + return (Message( + subject='Incident notification for {% include "incident_summary.txt.j2" %}', + to=[subscriber], + body='{% include "incident_description.txt.j2" %}', + ),)