Skip to content

mattermost-community/mattermost-plugin-newchannelnotify

Repository files navigation

Mattermost New Channel Notify Plugin

A server-side Mattermost plugin that posts an announcement into a designated channel whenever a new channel is created. Useful for keeping a team aware of new spaces as they appear.

How it works

The plugin listens for the ChannelHasBeenCreated server hook. When a public (or, optionally, private) channel is created, a bot posts a configurable message into the channel named in Channel to Post, resolved within the same team as the new channel. Direct and group messages are never announced.

Installation

  1. Build the plugin bundle with make dist (or download a release .tar.gz).
  2. Upload it via System Console → Plugins → Plugin Management.
  3. Enable the plugin.
  4. Configure the settings below under the plugin's entry in the System Console.

The bot user is created automatically on activation — you do not need to create it manually.

Configuration

Setting Description
Bot Name Username of the bot that posts messages (lowercase). Created automatically if it does not exist. Default newchannelbot.
Channel to Post The channel name (URL handle) to post into. Resolved within the team the new channel belongs to, so each watched team needs a channel with this name. Default town-square.
Bot Message Template The announcement text. Supports the placeholders below. Blank uses the default template.
Include private channels When true, new private channels also trigger an announcement. Default false.
Mention Prepended to the message: @channel, @here, or None.
Teams Semicolon-separated list of team names to monitor. Empty means all teams.

Message template placeholders

Placeholder Renders as
{channel::name} The channel name (URL handle)
{channel::displayName} The channel display name
{channel::nameAsLink} The channel name as a link (~name)
{channel::creator} The creator's name as a mention (@username)
{channel::purpose} The channel purpose, bolded if present

Default template:

Hello there :wave:. You might want to check out the new channel {channel::nameAsLink} created by {channel::creator}. {channel::displayName}'s purpose is '{channel::purpose}'

Development

Built from the Mattermost plugin starter template, stripped down to a server-only plugin (no webapp, slash commands, HTTP API, KV store, or background jobs).

make check-style   # gofmt + golangci-lint + go vet
make test          # run unit tests
make dist          # build the distributable bundle in dist/

Deploy to a local server (set the env vars first):

export MM_SERVICESETTINGS_SITEURL=http://localhost:8065
export MM_ADMIN_USERNAME=admin
export MM_ADMIN_PASSWORD=password
make deploy

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors