diff --git a/config/notifiers.go b/config/notifiers.go index 583827e6..3dc42948 100644 --- a/config/notifiers.go +++ b/config/notifiers.go @@ -305,6 +305,8 @@ type SlackConfig struct { Fallback string `yaml:"fallback,omitempty" json:"fallback,omitempty"` IconEmoji string `yaml:"icon_emoji,omitempty" json:"icon_emoji,omitempty"` IconURL string `yaml:"icon_url,omitempty" json:"icon_url,omitempty"` + ImageURL string `yaml:"image_url,omitempty" json:"image_url,omitempty"` + ThumbURL string `yaml:"thumb_url,omitempty" json:"thumb_url,omitempty"` LinkNames bool `yaml:"link_names,omitempty" json:"link_names,omitempty"` Actions []*SlackAction `yaml:"actions,omitempty" json:"actions,omitempty"` } diff --git a/notify/impl.go b/notify/impl.go index f7138369..f1d02f77 100644 --- a/notify/impl.go +++ b/notify/impl.go @@ -667,6 +667,8 @@ type slackAttachment struct { Fallback string `json:"fallback"` Fields []config.SlackField `json:"fields,omitempty"` Actions []config.SlackAction `json:"actions,omitempty"` + ImageURL string `json:"image_url,omitempty"` + ThumbURL string `json:"thumb_url,omitempty"` Footer string `json:"footer"` Color string `json:"color,omitempty"` @@ -687,6 +689,8 @@ func (n *Slack) Notify(ctx context.Context, as ...*types.Alert) (bool, error) { Pretext: tmplText(n.conf.Pretext), Text: tmplText(n.conf.Text), Fallback: tmplText(n.conf.Fallback), + ImageURL: tmplText(n.conf.ImageURL), + ThumbURL: tmplText(n.conf.ThumbURL), Footer: tmplText(n.conf.Footer), Color: tmplText(n.conf.Color), MrkdwnIn: []string{"fallback", "pretext", "text"},