Skip to content

Commit

Permalink
Fix notification templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton authored and Anton committed Nov 3, 2024
1 parent faeb16b commit f86c5e7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions internal/templates/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ var templatesMap = map[string]string{
// Profile
//

var profileGet = `<bold>Name:</bold> <code>hacker</code>
{{ if .Params.TelegramID }}<bold>Telegram ID:</bold> <code>12345678</code>
var profileGet = `<bold>Name:</bold> <code>{{ .Name }}</code>
{{ if .Params.TelegramID }}<bold>Telegram ID:</bold> <code>{{ .Params.TelegramID }}</code>
{{ end -}}
<bold>API token:</bold> <code>00112233445566778899aabbccddeeff</code>
{{ if .Params.LarkUserID }}<bold>Lark ID:</bold> <code>{{ .Params.LarkUserID }}</code>
{{ end -}}
<bold>API token:</bold> <code>{{ .Params.APIToken }}</code>
<bold>Admin:</bold> <code>{{ .IsAdmin }}</code>`

//
Expand Down Expand Up @@ -128,7 +130,7 @@ const (
NotificationBodyID = "notification/body"
)

var notificationHeader = `<bold>[{{ .Payload.Name }}]</bold> {{ .Event.Protocol.String | upper }} from 100.100.100.100:12345 {{ .Event.ReceivedAt.Format "on 02 Jan 2006 at 15:04:05 MST" }}`
var notificationHeader = `<bold>[{{ .Payload.Name }}]</bold> {{ .Event.Protocol.String | upper }} from {{ .Event.RemoteAddr }} {{ .Event.ReceivedAt.Format "on 02 Jan 2006 at 15:04:05 MST" }}`
var notificationBody = `<pre>
{{ printf "%s" .Event.RW }}
</pre>`

0 comments on commit f86c5e7

Please sign in to comment.