class MattermostService < ChatNotificationService
def title
'Mattermost notifications'
end
def description
'Receive event notifications in Mattermost'
end
def to_param
'mattermost'
end
def help
'This service sends notifications about projects events to Mattermost channels.
To set up this service:
- Enable incoming webhooks in your Mattermost installation.
- Add an incoming webhook in your Mattermost team. The default channel can be overridden for each event.
- Paste the webhook URL into the field bellow.
- 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: 'http://mattermost_host/hooks/...' },
{ type: 'text', name: 'username', placeholder: 'username' },
{ type: 'checkbox', name: 'notify_only_broken_builds' },
{ type: 'checkbox', name: 'notify_only_broken_pipelines' },
]
end
def default_channel_placeholder
"#town-square"
end
end