Skip to content

Conversation

@mveytsman
Copy link
Member

Summary

This PR adds per-program Slack channel configuration for delivery note notifications. Previously, all delivery notes were posted to a single hardcoded Slack channel. Now, each program can optionally specify its own Slack channel, allowing for better organization of notifications across different programs.

Changes

Database

  • Added slack_channel_id field to the programs table to store the Slack channel ID for each program

Backend

  • SlackApi module: Added list_channels/0 function to fetch available Slack channels from the API
  • SlackApi.Http: Implemented get!/2 to support GET requests to the Slack API
  • Messaging.Slack.DeliveryNotes:
    • Modified post_message!/2 to accept a channel parameter
    • Updated notify_note_created!/1 and notify_note_resolved!/2 to use program-specific channel
    • Added get_channel_id/1 helper that retrieves the channel from the program, falling back to the default config
      channel if none is set

Frontend

  • Program form: Added Slack channel selector dropdown
    • Fetches and displays available Slack channels (filtered to "campaigns-*" and "api-playground" channels)
    • Allows programs to select a specific channel or leave it unset to use the default
    • Gracefully handles Slack API errors by showing an empty list

Behavior

  • When a delivery note is created or resolved, the system checks if the associated program has a slack_channel_id
    configured
  • If configured, the notification is posted to that program's channel
  • If not configured, the notification falls back to the default channel from config
  • Programs can be updated to use different channels at any time through the program edit form

Copy link
Contributor

@teesloane teesloane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why CI is failing on a mix format - I tried formatting locally and no changes resulted.

LGTM

@mveytsman mveytsman force-pushed the mvty/slack-program-integrations branch from 16d8258 to a493746 Compare December 9, 2025 20:35
@mveytsman mveytsman merged commit c960dc8 into main Dec 23, 2025
1 check passed
@mveytsman mveytsman deleted the mvty/slack-program-integrations branch December 23, 2025 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants