diff --git a/docs/services/slack.md b/docs/services/slack.md index 0f3fdf17..16580010 100644 --- a/docs/services/slack.md +++ b/docs/services/slack.md @@ -15,6 +15,7 @@ The Slack notification service configuration includes following settings: | `signingSecret` | False | `string` | | `8f742231b10e8888abcd99yyyzzz85a5` | | `token` | **True** | `string` | The app's OAuth access token. | `xoxb-1234567890-1234567890123-5n38u5ed63fgzqlvuyxvxcx6` | | `username` | False | `string` | The app username. | `argocd` | +| `disableUnfurl` | False | `bool` | Disable slack unfurling links in messages | `true` | ## Configuration diff --git a/pkg/services/slack.go b/pkg/services/slack.go index 6c2b9b20..5e9678bc 100644 --- a/pkg/services/slack.go +++ b/pkg/services/slack.go @@ -79,6 +79,7 @@ type SlackOptions struct { Channels []string `json:"channels"` InsecureSkipVerify bool `json:"insecureSkipVerify"` ApiURL string `json:"apiURL"` + DisableUnfurl bool `json:"disableUnfurl"` } type slackService struct { @@ -125,6 +126,10 @@ func buildMessageOptions(notification Notification, dest Destination, opts Slack slackNotification = notification.Slack } + if opts.DisableUnfurl { + msgOptions = append(msgOptions, slack.MsgOptionDisableLinkUnfurl(), slack.MsgOptionDisableMediaUnfurl()) + } + return slackNotification, msgOptions, nil }