Slack Integration module
Collaboration and workflow Incubator
| Issues | |||
| Git | |||
| Latest | 1.2 
 | 
The Slack Integration module provides different connection points to Slack.
| This module is at the INCUBATOR level. | 
Installing with Maven
Maven is the easiest way to install the module. Add the following to your bundle:
<dependency>
  <groupId>info.magnolia.slack</groupId>
  <artifactId>magnolia-slack-integration</artifactId>
  <version>1.2</version>
</dependency>Usage
To configure the Slack connections, you will need to create the following file /decorations/slack-integration/config.yaml in a Magnolia (light) module.
| To send a message on a Slack channel, you need to configure an incoming webhook as described here. You can then define different channel connections as following: | 
connections:
  channel1:
    url: https://hooks.slack.com/services/XXXXXXXXX/YYYYYYYYYYY/ajaskasnsjsajsasjasnasia
  channel2:
    url: https://hooks.slack.com/services/XXXXXXXXX/YYYYYYYYYYY/wqkwqnwqiqnwqiwqwmlqwqmw
  channel3:
    url: https://hooks.slack.com/services/XXXXXXXXX/YYYYYYYYYYY/owqwqwqwqowqwokqwqowkqowIntegration
Node publication notification
In a Magnolia module, create the following file /hooks/slack-node-publish.yaml.
| The name slack-node-publish.yamlis for example purposes. It can be different. | 
The command sendNodeToChannel sends generic information about the node which has been published.
class: info.magnolia.slack.webhook.SlackWebhookDefinition
description: Post a message on any configuration change
connectionName: channel1
catalog: slack
commandName: sendNodeToChannel
trigger:
  workspace: config
  actions:
    - PUBLISHDam asset publication notification
In a Magnolia module, create the following file /hooks/slack-asset-publish.yaml.
| The name slack-asset-publish.yamlis for example purposes. It can be different. | 
In order to display the asset node specific attributes, use the command sendAssetToChannel as following:
class: info.magnolia.slack.webhook.SlackWebhookDefinition
description: Post a message on DAM asset publication
connectionName: channel2
catalog: slack
commandName: sendAssetToChannel
trigger:
  nodeType: mgnl:asset
  actions:
    - PUBLISHPage publication notification
In a Magnolia module, create the following file /hooks/slack-page-publish.yaml.
| The name slack-page-publish.yamlis for example purposes. It can be different. | 
In order to display the page node specific attributes, use the command sendPageToChannel as following:
class: info.magnolia.slack.webhook.SlackWebhookDefinition
description: Post a message on page publication
connectionName: channel2
catalog: slack
commandName: sendPageToChannel
trigger:
  nodeType: mgnl:page
  actions:
    - PUBLISHPublication request notification
In a Magnolia module, create the following file /hooks/slack-page-request-publish.yaml.
| The name slack-page-request-publish.yamlis for example purposes. It can be different. | 
In order to display the publication request attributes, use the command sendPublicationTaskToChannel as following:
class: info.magnolia.slack.webhook.SlackWebhookDefinition
description: Post a publication workflow task to Slack
connectionName: channel3
catalog: slack
commandName: sendPublicationTaskToChannel
trigger:
  nodeType: mgnl:page
  actions:
    - SUBMIT_PUBLISH