Class: MattermostService

Inherits:
ChatNotificationService show all
Includes:
SlackService::Notifier
Defined in:
app/models/project_services/mattermost_service.rb

Constant Summary

Constants inherited from ChatNotificationService

ChatNotificationService::EVENT_CHANNEL, ChatNotificationService::SUPPORTED_EVENTS

Constants inherited from Service

Service::DEV_SERVICE_NAMES, Service::SERVICE_NAMES

Instance Attribute Summary

Attributes included from Importable

#imported, #importing

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ChatNotificationService

#confidential_issue_channel, #confidential_note_channel, #default_fields, #event_channel_names, #event_field, #execute, #fields, #global_fields, #initialize_properties, supported_events

Methods included from NotificationBranchSelection

#branch_choices, #notify_for_branch?

Methods inherited from Service

#activated?, #api_field_names, #async_execute, available_services_names, available_services_types, boolean_accessor, build_from_integration, #can_test?, #category, #configurable_event_actions, #configurable_events, default_integration, dev_services_names, #editable?, #event_channel_names, event_description, #event_field, #event_names, event_names, #execute, #fields, find_or_create_templates, find_or_initialize_all, find_or_initialize_integration, #global_fields, #initialize_properties, instance_exists_for?, #issue_tracker?, #json_fields, #operating?, prop_accessor, #reset_updated_properties, services_names, services_types, #show_active_box?, supported_event_actions, supported_events, #supported_events, #supports_data_fields?, #test, #to_data_fields_hash, #to_param, #to_service_hash, #updated_properties

Methods included from ProjectServicesLoggable

#build_message, #log_error, #log_info, #logger

Methods inherited from ApplicationRecord

at_most, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, underscore, without_order

Class Method Details

.to_paramObject


14
15
16
# File 'app/models/project_services/mattermost_service.rb', line 14

def self.to_param
  'mattermost'
end

Instance Method Details

#default_channel_placeholderObject


29
30
31
# File 'app/models/project_services/mattermost_service.rb', line 29

def default_channel_placeholder
  "Channel handle (e.g. town-square)"
end

#descriptionObject


10
11
12
# File 'app/models/project_services/mattermost_service.rb', line 10

def description
  'Receive event notifications in Mattermost'
end

#helpObject


18
19
20
21
22
23
24
25
26
27
# File 'app/models/project_services/mattermost_service.rb', line 18

def help
  'This service sends notifications about projects events to Mattermost channels.<br />
  To set up this service:
  <ol>
    <li><a href="https://docs.mattermost.com/developer/webhooks-incoming.html#enabling-incoming-webhooks">Enable incoming webhooks</a> in your Mattermost installation.</li>
    <li><a href="https://docs.mattermost.com/developer/webhooks-incoming.html#creating-integrations-using-incoming-webhooks">Add an incoming webhook</a> in your Mattermost team. The default channel can be overridden for each event.</li>
    <li>Paste the webhook <strong>URL</strong> into the field below.</li>
    <li>Select events below to enable notifications. The <strong>Channel handle</strong> and <strong>Username</strong> fields are optional.</li>
  </ol>'
end

#titleObject


6
7
8
# File 'app/models/project_services/mattermost_service.rb', line 6

def title
  'Mattermost notifications'
end

#webhook_placeholderObject


33
34
35
# File 'app/models/project_services/mattermost_service.rb', line 33

def webhook_placeholder
  'http://mattermost.example.com/hooks/…'
end