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].
Click [From an app manifest] on the displayed modal.
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].
Copy & paste the code below in the "YAML" text area and click [NEXT].
_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
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.
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].
Access permission request will be displayed so click [Allow].
Next, check the token.
Click [OAuth & Permissions] on the side menu.
Copy "Bot User OAuth Token".
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.
Click [Add App Icon] on "Display Information".
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.
Check the app
On your Slack workspace, click [App] > [Add apps], search "KurocoNotification" and click the displayed app "KurocoNotification".
"KurocoNotification" is added in the app.
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.
Click [Integrations] > [Add an App].
Add "KurocoNotification".
Kuroco settings
Integrate Kuroco with Slack
Aceess your Kuroco admin panel and click [External system integration] > [Slack] on the side menu.
Check [Enable], enter the "Bot user OAuth token" you copied previously and click [Update].
Now, you are ready to send the notification to your Slack workspace.
Edit message template
Click [Operation] > [Message template].
Search for "inquiry/inquiry_contact" and click the displayed title [inquiry/inquiry_contact].
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*}
Replace YOUR-CHANNEL-NAME
with your own channel name in which you want to receive the notification.
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].
- 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>
(ReplaceSLACK-MEMBER-ID
with the actual ID of the member who you want to mention).
Form basic settings
Click [Campaign] > [Form].
Click the title of the form.
On the basic settings tab, check [Notify] and enter the email address and title.
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.
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.
Related documents
Support
If you have any other questions, please contact us or check out Our Slack Community.