Skip to content

Commit

Permalink
chore: new channel id for our contact form
Browse files Browse the repository at this point in the history
  • Loading branch information
georgiee authored Oct 9, 2023
1 parent dbc9650 commit 72ff19e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/contact-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }),
Expand Down

0 comments on commit 72ff19e

Please sign in to comment.