From 11b5b4b1678ffd724354b275c4570cb1795e55c5 Mon Sep 17 00:00:00 2001 From: Anton Prokhorov Date: Sun, 3 Nov 2024 00:06:28 +0000 Subject: [PATCH] Fix notification templates (#183) --- internal/templates/content.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/templates/content.go b/internal/templates/content.go index d703e62..acdc911 100644 --- a/internal/templates/content.go +++ b/internal/templates/content.go @@ -37,10 +37,12 @@ var templatesMap = map[string]string{ // Profile // -var profileGet = `Name: hacker -{{ if .Params.TelegramID }}Telegram ID: 12345678 +var profileGet = `Name: {{ .Name }} +{{ if .Params.TelegramID }}Telegram ID: {{ .Params.TelegramID }} {{ end -}} -API token: 00112233445566778899aabbccddeeff +{{ if .Params.LarkUserID }}Lark ID: {{ .Params.LarkUserID }} +{{ end -}} +API token: {{ .Params.APIToken }} Admin: {{ .IsAdmin }}` // @@ -128,7 +130,7 @@ const ( NotificationBodyID = "notification/body" ) -var notificationHeader = `[{{ .Payload.Name }}] {{ .Event.Protocol.String | upper }} from 100.100.100.100:12345 {{ .Event.ReceivedAt.Format "on 02 Jan 2006 at 15:04:05 MST" }}` +var notificationHeader = `[{{ .Payload.Name }}] {{ .Event.Protocol.String | upper }} from {{ .Event.RemoteAddr }} {{ .Event.ReceivedAt.Format "on 02 Jan 2006 at 15:04:05 MST" }}` var notificationBody = `
 {{ printf "%s" .Event.RW }}
 
`