Changeset

4620:9b253cce7d88

mod_pubsub_alertmanager: Allow configuring template for <body> rendering
author Kim Alvefur <zash@zash.se>
date Fri, 16 Jul 2021 12:26:55 +0200
parents 4619:b11001bd915d
children 4621:ebc2c099a11b
files mod_pubsub_alertmanager/mod_pubsub_alertmanager.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_pubsub_alertmanager/mod_pubsub_alertmanager.lua	Thu Jul 01 00:07:27 2021 +0200
+++ b/mod_pubsub_alertmanager/mod_pubsub_alertmanager.lua	Fri Jul 16 12:26:55 2021 +0200
@@ -57,7 +57,7 @@
 	return 202;
 end
 
-local template = [[
+local template = module:get_option_string("alertmanager_body_template", [[
 *ALARM!*
 Status: {status}
 Starts at: {startsAt}{endsAt&
@@ -66,7 +66,7 @@
   {idx}: {item}}
 Annotations: {annotations%
   {idx}: {item}}
-]]
+]]);
 
 module:hook("pubsub-summary/urn:uuid:e3bec775-c607-4e9b-9a3f-94de1316d861:v4", function(event)
 	local payload = event.payload;