Skip to content

Commit

Permalink
Add markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
rdelcorro committed Dec 28, 2020
1 parent e355f7f commit ee1f443
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions middlewares/gotify.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (m *Gotify) pushMessage(ctx *core.Context) {
}

func (m *Gotify) buildMessage(ctx *core.Context) *gotifyMessage {
msg := &gotifyMessage{Title: ctx.Job.GetName(), Priority: m.GotifyPriority}
msg := &gotifyMessage{Title: ctx.Job.GetName(), Priority: m.GotifyPriority, Extras: gotifyMessageExtras{ClientDisplay: gotifyMessageExtrasDisplay{ContentType: "text/markdown"}}}

msg.Message = fmt.Sprintf(
"Job *%q* finished in *%s*, command `%s`",
Expand All @@ -73,7 +73,16 @@ func (m *Gotify) buildMessage(ctx *core.Context) *gotifyMessage {
}

type gotifyMessage struct {
Title string `json:"title"`
Message string `json:"message"`
Priority int64 `json:"priority"`
Title string `json:"title"`
Message string `json:"message"`
Priority int64 `json:"priority"`
Extras gotifyMessageExtras `json:"extras"`
}

type gotifyMessageExtras struct {
ClientDisplay gotifyMessageExtrasDisplay `json:"client::display"`
}

type gotifyMessageExtrasDisplay struct {
ContentType string `json:"contentType"`
}

0 comments on commit ee1f443

Please sign in to comment.