Notification to ALL users on Mattermost

Getting ready to migrate and need to send an alert to ALL users on every team and channel. Is there a way to send a noticiation without going to each individual channel?

The simplest way I can think of would be if all users are member of a specific channel, then you could simple send a @here message on it, but aside from that I know of no built-in method to achieve your needs other than making it your self using the API, you could easily write some code to do that on pretty much any language or even using curl directly.

You would need the following methods:

https://api.mattermost.com/v4/#tag/authentication
https://api.mattermost.com/v4/#tag/users%2Fpaths%2F~1users%2Fget
https://api.mattermost.com/v4/#tag/channels%2Fpaths%2F~1channels~1direct%2Fpost
https://api.mattermost.com/v4/#tag/posts%2Fpaths%2F~1posts%2Fpost

So basically you authenticate, then get a list with all users, then generate a DM with each or a GM and then post a message to that channel using its ID.

Hah, guess I’ve got to try and learn golang now…

Everyone on a Team is a member of the Town Square channel, which is the only channel that a team member cannot leave. You could post a message there, and everyone on the team will see it.

1 Like

Didn’t know that… I’ll try it this evening. Thanks Jeff!

You can use the API in literally ANY language you wish, you’re not tied to Go

@JeffSchering nicely spotted completely forgot that :slight_smile:

The only problem with that would be if they had it disabled on the channel settings not sure if possible on the default channel.