def formatter(data, headers): """Pretty-print an alertmanager notification.""" text = "" for alert in data['alerts']: text += f"[{alert['status']}] - {alert['labels']['summary']}\n\n" data["body"] = text return data