Your Mattermost server needs to be accessible from your Discourse server in order to connect them. It is recommended that you use HTTPS, but HTTP should also work.
In your Mattermost System Console, under Custom Integrations, check that these settings are enabled:
Enable Incoming Webhooks
Enable integrations to override usernames
Enable integrations to override profile picture icons
Enable Custom Slash Commands (if you want slash commands)
Login to your team, click your name in the top left, then click Integrations
Choose Incoming Webhooks, Add incoming Webhook
Enter a “Display Name”, “Description”, and choose a random channel from the list (it doesn’t matter which one, Discourse will override this)
Save
Copy the URL provided, you’ll need it later
Setup Discourse
Paste the URL you copied into the chat_integration_mattermost_webhook_url site setting
Enable chat_integration_mattermost_enabled
Setup some “Rules” for your channels, according to the discourse-chat-integration instructions. Channel identifiers look like #town-square or @davidtaylor.
Click Test on one of the channels to check everything’s working. You should receive a message like this:
Slash Commands
Slash commands allow you to manage your rules from inside Mattermost. To get it working:
If you didn’t already, enable Enable Custom Slash Commands in your Mattermost System Console
Login to your team, click your name in the top left, then click Integrations
Hello! I am getting a broken image link to the right of the mattermost post. I tried to see the image url and it looks like an actual post instead of an image:
Make sure you copied the webhook URL correctly, and that there are no spaces before/after the URL. Is your mattermost server accessible to the internet? Or just an internal network?
3 Likes
csmu
(Keith John Hutchison - Ceiteach Seán Mac Úistin)
12
What’s the best way to handle multiple teams / multiple mattermost servers?
I have chat integration with mattermost enabled - i subscribed to all “top level” categories that are displayed via the “/discourse watch” command but posts to “sub categories” are not caught.
it is relayed to slack properly - but it is NOT relayed to mattermost. Slack is able to subscribe to “all categories”. Mattermost does not seem to be able to.
I’ve tried all the syntax I can think of but I’ve not had luck. Any tips??
At the moment, sub-categories are not automatically included when you “watch” a category. You’ll need to either add every individual subcategory, or use the “all categories” option.
Hey, thanks for replying!!! that’d be sweet if I could figure out ‘how’. The only categories that the plugin seems to recognize are the topmost categories?
I found/tried the “all categories” option but that also doesn’t seem to work? Man I’d really love to just use “all”, that’d be IDEAL… Am i “doing it wrong”? See screen cap below
Hi @david… the problem with the above is i cannot figure out how to sub to a “subcategory” nor does there seem to be an “all” i can use? I’d love to get this figured out.
Using slash commands, I think you can watch all categories like this:
/discourse watch
But the easiest way to configure notification rules is from the Discourse admin panel. There, all the options are clearly displayed in the UI, so there’s no need to try and work out the precise ‘slash command’ syntax. Check out the ‘configuring rules’ section of the plugin’s documentation for more info.
I posted a screen cap from the slash command before. reposting it here… you can see the ‘sub categories’ are not listed a post or two above…
I had tried the admin page before but it would immediately close the dropdown when I used it… However pressing the ‘down arrow’ seemed to jar whatever I needed loose.
I would REALLY like an ‘all’ option. Is this a plugin I can somehow edit/fix??? Right now it looks like this
(‘no category’ in the dropdown is clearly a bad description of what it actually means. I’ll get that fixed up)
I think subcategories are ommitted from the help text for space. But you can still subscribe to categories by using their ‘slug’ (the name of the subcategory from the URL). So in the case of #howto:admins here on Meta, it would be /discourse watch admins.