Skip to main content

Send notification of receiving inquiries to Slack.

Summary

Kuroco has an API linkage function with Slack.
With API linkage, you can easily read Slack messages and post to Slack channels from your Kuroco site.

This tutorial explains how to post notifications of receiving inquiries to Slack by integrating with Slack.

What you will learn

The flow of this tutorial is as follows:

Create Slack app

First, we explain how to install Slack app.

Appを作成する

Access Slack API and click [Create New App].

Image from Gyazo

Click [From an app manifest] on the displayed modal.

Image from Gyazo

The Workspace selection screen is displayed.
From the "Pick a workspace to develop your app in:" field, select the workspace where you want to use the App and click [Next].

Image from Gyazo

Copy & paste the code below in the "YAML" text area and click [NEXT].

Image from Gyazo

_metadata:
major_version: 1
minor_version: 1
display_information:
name: KurocoNotification
features:
bot_user:
display_name: KurocoNotification
always_online: true
oauth_config:
scopes:
bot:
- chat:write
- im:write
tip

The above settings allow bots to add messages to Slack.
If you want to read channel information or posted content, please refer to the Slack reference.
-Create and configure apps with manifests
-OAuth Permission scopes

Click [Create] to complete the API creation.

Image from Gyazo

Install the app to your workspace

Next, install the API you just created into Workspace.

Click [Install App] on the side menu and then click [Install to Workspace].

Image from Gyazo

Access permission request will be displayed so click [Allow].

Image from Gyazo

Next, check the token.
Click [OAuth & Permissions] on the side menu.

Image from Gyazo

Copy "Bot User OAuth Token".

Image from Gyazo

Update App information

By default, the app icon is not displayed, so we need to set the image by the following process.

Click [Basic Information] on the side menu.
Image from Gyazo

Click [Add App Icon] on "Display Information".

Image from Gyazo

In this tutorial, we upload the Kuroco's icon.(You can download the image from here.) Once the image is uploaded, it is complete.
The icon is now set.

Image from Gyazo

Check the app

On your Slack workspace, click [App] > [Add apps], search "KurocoNotification" and click the displayed app "KurocoNotification". Image from Gyazo

"KurocoNotification" is added in the app.

Image from Gyazo

Add app to the Slack channel

Add the App to the Slack channel that receives notifications from KurocoNotification.

Click on the channel name at the top left in the channel where you want to receive notifications.
Image from Gyazo

Click [Integrations] > [Add an App].

Image from Gyazo

Add "KurocoNotification".

Image from Gyazo

Kuroco settings

Integrate Kuroco with Slack

Aceess your Kuroco admin panel and click [External system integration] > [Slack] on the side menu.

Image from Gyazo

Check [Enable], enter the "Bot user OAuth token" you copied previously and click [Update].

Image from Gyazo

Now, you are ready to send the notification to your Slack workspace.

Edit message template

Click [Operation] > [Message template].

Image from Gyazo

Search for "inquiry/inquiry_contact" and click the displayed title [inquiry/inquiry_contact].

Image from Gyazo

Add the following at the beginning of the "Body".

{*Slack notification*}
{capture name=slack_text_body}
<!here>
You received an inquiry to "{$inquiryHeader.inquiry_name}".
Check the detail from the link below:
{$smarty.const.ROOT_MNG_URL}/management/inquiry/inquiry_reply_edit/?inquiry_bn_id={$inquiry_bn_id}
{/capture}
{slack_post_message channel='YOUR-CHANNEL-NAME' text=$smarty.capture.slack_text_body}

{*Email notification*}
caution

Replace YOUR-CHANNEL-NAME with your own channel name in which you want to receive the notification.

Image from Gyazo

Click [Update] to save the settings.

TIPS

  • If you want to send the notification only to Slack, set "Stop sending email" to "1" from the [custom settings].
    Image from Gyazo
  • If you want to set the mention on Slack to @channel, write <!channel>.
  • If you want to mention a person on Slack, write <@SLACK-MEMBER-ID>(Replace SLACK-MEMBER-ID with the actual ID of the member who you want to mention).

Form basic settings

Click [Campaign] > [Form].

Image from Gyazo

Click the title of the form.
Image from Gyazo

On the basic settings tab, check [Notify] and enter the email address and title.

Image from Gyazo

Operation check

Finally, we check the operation.
When you submit a response to a form with admin notifications enabled, you'll get a Slack channel notification in addition to the email notification.

Image from Gyazo

With the above steps, you can now send notification of the received inquiries to Slack.

You can also use the same method to send other notifications such as approval workflows to Slack, so please give it a try.


Support

If you have any other questions, please contact us or check out Our Slack Community.