This article walks through how to build an app that sends a Slack notification every time your account receives a new review. The setup involves three parts: creating the Slack app, uploading a plugin to your Yext account, and creating a Yext app that connects the two.
Requirements
- A Slack workspace where you have permission to create apps, or approval from your Slack administrator
- A Yext account with access to Account Features and the Developer Console
Step 1: Create a Slack App
- Create or identify the Slack channel where you want review notifications to appear.
- Go to api.slack.com/apps and click Create New App.
- Select From Scratch, enter an app name, and select your workspace.
- Under Add Features and Functionality, click Incoming Webhooks.
- Toggle the feature on.
- Click Request to Add New Webhook and include a message to your Slack administrator explaining what the webhook will do.
- After your administrator approves the request, return to api.slack.com/apps, select your app, and go back to Incoming Webhooks.
- Click Add New Webhook to Workspace, select the channel for review notifications, and click Allow.
- Copy the Webhook URL at the bottom of the page. You will need it in Step 2.
Step 2: Upload the Publisher Plugin
- Navigate to Account Settings > Account Features and enable Summer '23: Trigger Serverless Functions in Apps (early access). Click Save.
- Go to this link to begin applying the Slack function to your account.
- Click Apply in the top right corner.
- Enter your Account ID and click Continue.
- Enter the Webhook URL you copied in Step 1 and your Account ID.
- Click Save, then Continue, then Confirm.
To verify the upload was successful, navigate to Developer > Admin Console and confirm you can see files under the path: platform > plugin > slackReviewsPublisher.
Step 3: Create a Yext App
- Navigate to Developer > Developer Console.
- Click Add an App, enter a name such as "Slack Reviews Publisher," and click Create App.
- Under the API Credentials tab, click Add a new API Permission. Select Management API > Reviews with Read-only permissions and click Save.
- Under the Webhooks tab, click Add a Webhook.
- Select Reviews as the Webhook Type and click Next.
- Enter a name for the webhook, such as "Slack Review Notification."
- Under URL, click Invoke a Function. Select slackReviewsPublisher and choose the function handleNotification.
- Click Finish and Add.
Your Slack channel will now receive a notification each time your account receives a new review.