diff --git a/matrix_webhook/formatters/grafana_9x.py b/matrix_webhook/formatters/grafana_9x.py new file mode 100644 index 0000000..41fe370 --- /dev/null +++ b/matrix_webhook/formatters/grafana_9x.py @@ -0,0 +1,9 @@ +def grafana_9x(data, headers): + """Pretty-print a Grafana newer than v9.x notification.""" + text = "" + if "title" in data: + text = "#### " + data["title"] + "\n" + if "message" in data: + text = text + data["message"].replace("\n", "\n\n") + "\n\n" + data["body"] = text + return data