Skip to content

feat(slack): notify on support conversations and visitor messages#335

Open
kytenz wants to merge 1 commit into
QuackbackIO:mainfrom
plannie-io:feat/slack-support-notifications
Open

feat(slack): notify on support conversations and visitor messages#335
kytenz wants to merge 1 commit into
QuackbackIO:mainfrom
plannie-io:feat/slack-support-notifications

Conversation

@kytenz

@kytenz kytenz commented Jul 21, 2026

Copy link
Copy Markdown

What

The Slack integration currently offers four notification types (new post, status change, comment, changelog), but nothing for the support inbox — teams get no Slack ping when a visitor starts a conversation or replies. The event bus already dispatches conversation.created and message.created (the generic webhook integration exposes them), so this teaches the Slack integration about them:

  • Admin UI: two new per-channel toggles in the Slack notification routing — New support conversation and New support message (SLACK_EVENT_CONFIG).
  • Renderer: Block Kit cards for both, matching the existing style, with a deep link to /admin/inbox?c=<conversationId>. Visitor name/email fall back to "Anonymous visitor"; content is stripHtml + mrkdwn-escaped + truncated like comment.created.
  • Agent filter: message.created fires for both directions, so agent-sent messages return null from buildSlackMessage — a team's own replies never notify. slackHook treats a null message as a successful no-op (buildSlackMessage signature is now SlackMessage | null).

Testing

  • New __tests__/message.test.ts: renders both events (escaping, inbox deep link, anonymous/missing-subject fallbacks), agent messages return null, unhandled event types still fall through to the generic text.
  • bun run test apps/web/src/lib/server/integrations/slack/ — 21/21 passing; changed files are eslint-clean.

No schema or server-function changes — event-mapping storage already accepts arbitrary event types.

The Slack integration only offered post/comment/changelog notifications,
while the event bus already dispatches conversation.created and
message.created from the support chat. Add both as routable Slack
notification types:

- SLACK_EVENT_CONFIG gains 'New support conversation' and 'New support
  message' toggles (per-channel, same as existing types)
- buildSlackMessage renders both with an /admin/inbox?c=<id> deep link;
  agent-sent messages return null so a team's own replies never notify
- slackHook treats a null message as a successful no-op
@CLAassistant

CLAassistant commented Jul 21, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants