debian-mirror-gitlab/app/models/project_services/slack_service.rb

32 lines
901 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
class SlackService < ChatNotificationService
2014-09-02 18:07:02 +05:30
def title
2017-08-17 22:00:37 +05:30
'Slack notifications'
2014-09-02 18:07:02 +05:30
end
def description
2017-08-17 22:00:37 +05:30
'Receive event notifications in Slack'
2014-09-02 18:07:02 +05:30
end
2017-08-17 22:00:37 +05:30
def self.to_param
2014-09-02 18:07:02 +05:30
'slack'
end
2015-09-25 12:07:36 +05:30
def help
2017-08-17 22:00:37 +05:30
'This service sends notifications about projects events to Slack channels.<br />
To set up this service:
<ol>
<li><a href="https://slack.com/apps/A0F7XDUAZ-incoming-webhooks">Add an incoming webhook</a> in your Slack team. The default channel can be overridden for each event.</li>
<li>Paste the <strong>Webhook URL</strong> into the field below.</li>
<li>Select events below to enable notifications. The <strong>Channel name</strong> and <strong>Username</strong> fields are optional.</li>
</ol>'
2016-08-24 12:49:21 +05:30
end
2017-08-17 22:00:37 +05:30
def default_channel_placeholder
"Channel name (e.g. general)"
2016-09-29 09:46:39 +05:30
end
2017-08-17 22:00:37 +05:30
def webhook_placeholder
'https://hooks.slack.com/services/…'
2016-09-29 09:46:39 +05:30
end
2014-09-02 18:07:02 +05:30
end