class SlackService < ChatNotificationService
def title
'Slack notifications'
end
def description
'Receive event notifications in Slack'
end
def to_param
'slack'
end
def help
'This service sends notifications about projects events to Slack channels.
To setup this service:
- Add an incoming webhook in your Slack team. The default channel can be overridden for each event.
- Paste the Webhook URL into the field below.
- Select events below to enable notifications. The channel and username are optional.
'
end
def fields
default_fields + build_event_channels
end
def default_fields
[
{ type: 'text', name: 'webhook', placeholder: 'https://hooks.slack.com/services/...' },
{ type: 'text', name: 'username', placeholder: 'username' },
{ type: 'checkbox', name: 'notify_only_broken_builds' },
{ type: 'checkbox', name: 'notify_only_broken_pipelines' },
]
end
def default_channel
"#general"
end
end