From c0c7049be6ad8926f6e4375d5eec1e702f125ec7 Mon Sep 17 00:00:00 2001 From: Georgios Kaleadis Date: Mon, 28 Aug 2023 14:12:23 +0200 Subject: [PATCH] chore: change contact form slack channel Let's collect our contact form requests in a new channel for an improved data retention policy. --- src/api/contact-form.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/contact-form.ts b/src/api/contact-form.ts index 29c83921a..a00755422 100644 --- a/src/api/contact-form.ts +++ b/src/api/contact-form.ts @@ -2,6 +2,7 @@ import { WebClient, LogLevel } from '@slack/web-api'; import { GatsbyFunctionRequest, GatsbyFunctionResponse } from 'gatsby'; const TOKEN = process.env.SLACK_BOT_SY_TOKEN; +const CHANNEL_ID = 'C05PQTZAW8M'; // our contact form channel /** * Easily build this block structure via https://app.slack.com/block-kit-builder @@ -81,14 +82,13 @@ export default async function handler( return res.status(500).json({ error: `no slack token given` }); } - const channelId = 'website'; const client = new WebClient(TOKEN, { logLevel: LogLevel.DEBUG, }); try { await client.chat.postMessage({ - channel: channelId, + channel: CHANNEL_ID, // raw text as the fallback content for notifications. text: `${first_name} (${email}) sent the following message:\n ${message}`, blocks: createSlackMessage({ first_name, email, message }),