diff --git a/opsgenie/widget.go b/opsgenie/widget.go index dfcf3c55..7b674af1 100644 --- a/opsgenie/widget.go +++ b/opsgenie/widget.go @@ -60,7 +60,7 @@ func (widget *Widget) contentFrom(onCallResponse *OnCallResponse) string { str := "\n" for _, data := range onCallResponse.OnCallData { - str = str + fmt.Sprintf(" [green]%s[white]\n", data.Parent.Name) + str = str + fmt.Sprintf(" [green]%s[white]\n", widget.cleanScheduleName(data.Parent.Name)) str = str + fmt.Sprintf(" %s\n", strings.Join(widget.namesFromEmails(data.Recipients), ", ")) str = str + "\n" } @@ -68,6 +68,10 @@ func (widget *Widget) contentFrom(onCallResponse *OnCallResponse) string { return str } +func (widget *Widget) cleanScheduleName(schedule string) string { + return strings.Replace(schedule, "_", " ", -1) +} + func (widget *Widget) namesFromEmails(emails []string) []string { names := []string{}