# Set up Mattermost notifications using the discourse-chat-integration plugin

**URL:** https://meta.discourse.org/t/set-up-mattermost-notifications-using-the-discourse-chat-integration-plugin/66811
**Category:** Integrations
**Tags:** chat-integration, how-to
**Created:** [25.Июль.2017 21:17:16 UTC](https://meta.discourse.org/t/set-up-mattermost-notifications-using-the-discourse-chat-integration-plugin/66811 "2017-07-25T21:17:16Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [25.Июль.2017 21:17:16 UTC](https://meta.discourse.org/t/set-up-mattermost-notifications-using-the-discourse-chat-integration-plugin/66811/1 "2017-07-25T21:17:16Z")

</div>

This #howto describes how to setup the Mattermost provider included in `discourse-chat-integration`.

# Enable

The `discourse-chat-integration` plugin is bundled with Discourse. No separate installation is required. To enable it, check that the `chat_integration_enabled` site setting is turned on.

# Notifications

### Set up Mattermost

> 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.

1. In your Mattermost **System Console** , under **Custom Integrations** , check that these settings are enabled:

2. Login to your team, click your name in the top left, then click Integrations

3. Choose Incoming Webhooks, Add incoming Webhook

4. Enter a “Display Name”, “Description”, and choose a random channel from the list (it doesn’t matter which one, Discourse will override this)

 ![](https://global.discourse-cdn.com/meta/original/3X/d/a/da17356f254cb84e84738ffe8f4a0652de2f2677.png)

1. Save

2. Copy the URL provided, you’ll need it later

### Setup Discourse

1. Paste the URL you copied into the `chat_integration_mattermost_webhook_url` site setting

2. Enable `chat_integration_mattermost_enabled`

3. Setup some “Rules” for your channels, according to the [discourse-chat-integration](https://meta.discourse.org/t/chatroom-integration-plugin-discourse-chat-integration/66522) instructions. Channel identifiers look like `#town-square` or `@davidtaylor`.

4. Click Test on one of the channels to check everything’s working. You should receive a message like this:  

5. :unicorn:

# Slash Commands

Slash commands allow you to manage your rules from inside Mattermost. To get it working:

1. If you didn’t already, enable **Enable Custom Slash Commands** in your Mattermost **System Console**

2. Login to your team, click your name in the top left, then click Integrations

3. Choose Slash Commands, Add slash command

4. Save

5. Copy the “Token” provided, and paste it into your Discourse site settings under `chat_integration_mattermost_incoming_webhook_token`

6. Try sending `/discourse help` in your mattermost channel - you should get a message with a list of possible commands

7. 🥇

> Last edited by @JammyDodger 2024-05-26T07:09:54Z
> 
> > **Check document**
> >
> > Perform check on document:

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [25.Июль.2017 21:36:44 UTC](https://meta.discourse.org/t/set-up-mattermost-notifications-using-the-discourse-chat-integration-plugin/66811/2 "2017-07-25T21:36:44Z")

</div>

I recommend you also post this on the mattermost Discourse to get more feedbacks 🤠

> **[Integration with Discourse](https://forum.mattermost.com/t/integration-with-discourse/193)**
>
> We’re wondering if it’s possible/feasible to integrate Mattermost with Discourse, so that signing up on one would create an account for the other (or both use the same login either way). This would be fantastic, so that users only need to register...

and probably a dedicated topic.

(also I wish we warned communities about hideous looking oneboxes cause they are missing images)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [26.Июль.2017 07:13:23 UTC](https://meta.discourse.org/t/set-up-mattermost-notifications-using-the-discourse-chat-integration-plugin/66811/3 "2017-07-26T07:13:23Z")

</div>

> [@sam](#):
>
> also I wish we warned communities about hideous looking oneboxes cause they are missing images

I think we already do in the dashboard if they use the default images for the logos.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [26.Июль.2017 13:47:50 UTC](https://meta.discourse.org/t/set-up-mattermost-notifications-using-the-discourse-chat-integration-plugin/66811/4 "2017-07-26T13:47:50Z")

</div>

Mattermost integration now supports slash commands (their implementation is built to be compatible with Slack’s) 🎉

I have also created a topic about it on the Mattermost forum, it can be found here:

> **[\[SOLVED\] Discourse integration with Mattermost](https://forum.mattermost.com/t/solved-discourse-integration-with-mattermost/3581)**
>
> 👋 Hi everyone. I’m participating in the Google Summer of Code programme, working on Discourse (the software that you’re reading this in!). I’ve built a plugin for Discourse called discourse-chat-integration. It allows for “cross-posting” posts on...

---

<div class="post-metadata">

### Author: ![nommaz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nommaz/32/64859_2.png) [@nommaz](https://meta.discourse.org/u/nommaz)
#### Post date: [09.Сентябрь.2017 15:04:05 UTC](https://meta.discourse.org/t/set-up-mattermost-notifications-using-the-discourse-chat-integration-plugin/66811/5 "2017-09-09T15:04:05Z")

</div>

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:

[http://destek.hugin.com.tr/t/hugin-destek-topluluguna-hos-geldiniz/183/1](http://destek.hugin.com.tr/t/hugin-destek-topluluguna-hos-geldiniz/183/1)

Is it intended to be the post author image I wonder?

Any tips on how to fix it?

 ![20 PM](https://global.discourse-cdn.com/meta/original/3X/5/9/594dfc99916caaf3c435a68f488443be49673036.png)

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [09.Сентябрь.2017 20:09:43 UTC](https://meta.discourse.org/t/set-up-mattermost-notifications-using-the-discourse-chat-integration-plugin/66811/6 "2017-09-09T20:09:43Z")

</div>

Hi @nommaz - sorry about that. It was indeed trying to load an image from the URL of the post, which clearly isn’t going to work 😉

I’ve fixed it now, so if you update to the latest version of the plugin it should work as intended 🙂

[https://github.com/discourse/discourse-chat-integration/commit/438a9d92fe6be632b825238ce703a03dd20d285b](https://github.com/discourse/discourse-chat-integration/commit/438a9d92fe6be632b825238ce703a03dd20d285b)

---

<div class="post-metadata">

### Author: ![nommaz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nommaz/32/64859_2.png) [@nommaz](https://meta.discourse.org/u/nommaz)
#### Post date: [09.Сентябрь.2017 22:01:15 UTC](https://meta.discourse.org/t/set-up-mattermost-notifications-using-the-discourse-chat-integration-plugin/66811/7 "2017-09-09T22:01:15Z")

</div>

Hi David didnt work unfortunately

Are you sure it is not an issue with mattermost\_provider.rb:68 ?

Thanks

Vedat

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [09.Сентябрь.2017 22:10:39 UTC](https://meta.discourse.org/t/set-up-mattermost-notifications-using-the-discourse-chat-integration-plugin/66811/8 "2017-09-09T22:10:39Z")

</div>

Oops, I made the change in the slack provider instead of mattermost :facepalm:

Just added another commit to correct the error, so please can you give it another try 🙂

---

<div class="post-metadata">

### Author: ![nommaz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nommaz/32/64859_2.png) [@nommaz](https://meta.discourse.org/u/nommaz)
#### Post date: [10.Сентябрь.2017 09:28:19 UTC](https://meta.discourse.org/t/set-up-mattermost-notifications-using-the-discourse-chat-integration-plugin/66811/9 "2017-09-10T09:28:19Z")

</div>

Thanks! All set now 🙂

---

<div class="post-metadata">

### Author: ![Syscoincmt](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@Syscoincmt](https://meta.discourse.org/u/Syscoincmt)
#### Post date: [05.Декабрь.2018 15:02:46 UTC](https://meta.discourse.org/t/set-up-mattermost-notifications-using-the-discourse-chat-integration-plugin/66811/10 "2018-12-05T15:02:46Z")

</div>

What’s up if I get a 422 error when trying (test) to hook to Mattermost?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [05.Декабрь.2018 15:04:37 UTC](https://meta.discourse.org/t/set-up-mattermost-notifications-using-the-discourse-chat-integration-plugin/66811/11 "2018-12-05T15:04:37Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![csmu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/csmu/32/124581_2.png) [@csmu](https://meta.discourse.org/u/csmu)
#### Post date: [15.Март.2019 03:01:49 UTC](https://meta.discourse.org/t/set-up-mattermost-notifications-using-the-discourse-chat-integration-plugin/66811/12 "2019-03-15T03:01:49Z")

</div>

> [@david](#):
>
> Paste the URL you copied into the `chat_integration_mattermost_webhook_url`

What’s the best way to handle multiple teams / multiple mattermost servers?

---

<div class="post-metadata">

### Author: ![Clint\_Dovholuk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/clint_dovholuk/32/250530_2.png) [@Clint\_Dovholuk](https://meta.discourse.org/u/Clint_Dovholuk)
#### Post date: [18.Февраль.2022 22:59:12 UTC](https://meta.discourse.org/t/set-up-mattermost-notifications-using-the-discourse-chat-integration-plugin/66811/13 "2022-02-18T22:59:12Z")

</div>

У меня включена интеграция чата с Mattermost — я подписался на все категории «верхнего уровня», которые отображаются через команду “/discourse watch”, но сообщения из «подкатегорий» не отслеживаются.

Вот пример поста: [https://openziti.discourse.group/t/this-is-a-test-topic-in-the-sdks-category/271](https://openziti.discourse.group/t/this-is-a-test-topic-in-the-sdks-category/271)

Он корректно пересылается в Slack, но не пересылается в Mattermost. Slack может подписываться на «все категории», а Mattermost, похоже, не может.

Я перепробовал все возможные варианты синтаксиса, но безрезультатно. Есть какие-нибудь советы??

Заранее спасибо…

---

<div class="post-metadata">

### Author: ![Clint\_Dovholuk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/clint_dovholuk/32/250530_2.png) [@Clint\_Dovholuk](https://meta.discourse.org/u/Clint_Dovholuk)
#### Post date: [26.Февраль.2022 21:04:01 UTC](https://meta.discourse.org/t/set-up-mattermost-notifications-using-the-discourse-chat-integration-plugin/66811/14 "2022-02-26T21:04:01Z")

</div>

> [@Clint\_Dovholuk](#):
>
> при включённой интеграции с Mattermost — я подписался на все «высшего уровня» категории, которые отображаются через команду «/discourse watch», но

@david — извините за упоминание, но я не вижу посты Discourse в своей интеграции чата. Есть ли шанс, что вы всё ещё следите за этой темой?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [26.Февраль.2022 22:44:09 UTC](https://meta.discourse.org/t/set-up-mattermost-notifications-using-the-discourse-chat-integration-plugin/66811/15 "2022-02-26T22:44:09Z")

</div>

На данный момент подкатегории автоматически не включаются при «подписке» на категорию. Вам нужно либо добавить каждую подкатегорию отдельно, либо использовать опцию «все категории».

---

<div class="post-metadata">

### Author: ![Clint\_Dovholuk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/clint_dovholuk/32/250530_2.png) [@Clint\_Dovholuk](https://meta.discourse.org/u/Clint_Dovholuk)
#### Post date: [28.Февраль.2022 18:36:27 UTC](https://meta.discourse.org/t/set-up-mattermost-notifications-using-the-discourse-chat-integration-plugin/66811/16 "2022-02-28T18:36:27Z")

</div>

Привет, спасибо за ответ!!! Было бы здорово, если бы я мог разобраться, «как». Похоже, плагин распознаёт только самые верхние категории?

Я нашёл/попробовал опцию «все категории», но, кажется, она тоже не работает? Ох, я бы очень хотел просто использовать «все», это было бы ИДЕАЛЬНО… Я что-то делаю не так? См. скриншот ниже

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/c/fc5e9856ef0e8eca7bf615de177ee54a081ef0c3.png)

---

<div class="post-metadata">

### Author: ![Clint\_Dovholuk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/clint_dovholuk/32/250530_2.png) [@Clint\_Dovholuk](https://meta.discourse.org/u/Clint_Dovholuk)
#### Post date: [09.Март.2022 13:53:54 UTC](https://meta.discourse.org/t/set-up-mattermost-notifications-using-the-discourse-chat-integration-plugin/66811/17 "2022-03-09T13:53:54Z")

</div>

> [@david](#):
>
> Вам нужно либо добавить каждую отдельную подкатегорию, либо использовать опцию «все категории».

Привет, @david… Проблема в том, что я не могу понять, как подписаться на «подкатегорию», и, похоже, нет возможности выбрать «все»? Мне бы очень хотелось разобраться в этом.

Спасибо!

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [09.Март.2022 13:55:47 UTC](https://meta.discourse.org/t/set-up-mattermost-notifications-using-the-discourse-chat-integration-plugin/66811/18 "2022-03-09T13:55:47Z")

</div>

Извините за задержку с ответом, @Clint_Dovholuk!

Используя команды со слэшем, я _думаю_, что вы можете следить за всеми категориями так:

```plaintext
/discourse watch

```

Но самый простой способ настроить правила уведомлений — через панель администратора Discourse. Там все варианты четко отображены в интерфейсе, поэтому не нужно пытаться разобраться в точном синтаксисе «команд со слэшем». Для получения дополнительной информации ознакомьтесь с разделом [«настройка правил»](https://meta.discourse.org/t/chatroom-integration-plugin-discourse-chat-integration/66522#configuring-rules-4) документации плагина.

---

<div class="post-metadata">

### Author: ![Clint\_Dovholuk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/clint_dovholuk/32/250530_2.png) [@Clint\_Dovholuk](https://meta.discourse.org/u/Clint_Dovholuk)
#### Post date: [10.Март.2022 00:03:44 UTC](https://meta.discourse.org/t/set-up-mattermost-notifications-using-the-discourse-chat-integration-plugin/66811/19 "2022-03-10T00:03:44Z")

</div>

Спасибо, @david.

Я уже публиковал скриншот команды со слэшем ранее. Повторно размещаю его здесь… Вы можете увидеть, что «подкатегории» не перечислены в одном или двух сообщениях выше…

Ранее я пробовал использовать страницу администратора, но выпадающий список сразу закрывался при её использовании… Однако нажатие стрелки вниз, похоже, освобождало то, что мне было нужно.

Мне **ОЧЕНЬ** нужна опция «Все». Это плагин, который я могу как-то отредактировать или исправить??? Сейчас это выглядит так 😕

 ![image](https://global.discourse-cdn.com/meta/original/3X/0/f/0f5435132986524de2366ced64f6becc3d728454.png)

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [10.Март.2022 00:18:40 UTC](https://meta.discourse.org/t/set-up-mattermost-notifications-using-the-discourse-chat-integration-plugin/66811/20 "2022-03-10T00:18:40Z")

</div>

> [@Clint\_Dovholuk](#):
>
> Сейчас это выглядит так

Чтобы получать уведомления обо всех темах, я рекомендую удалить все правила, привязанные к конкретным категориям, а затем добавить одно правило «все категории».

> [@Clint\_Dovholuk](#):
>
> Я уже пробовал страницу администратора, но при использовании она сразу закрывала выпадающее меню…

Можете ли вы предоставить больше деталей о том, что именно вы видите? Скриншоты или видео были бы очень кстати!

При редактировании «правила» вы должны иметь возможность использовать выпадающее меню категорий, чтобы выбрать «(нет категории)».

 ![Screenshot 2022-03-10 at 00.07.41](https://global.discourse-cdn.com/meta/original/3X/2/9/298f4b65c4318e7f2090fe54d355ab818756517c.png)

После сохранения это должно выглядеть так:

 ![Screenshot 2022-03-10 at 00.08.57](https://global.discourse-cdn.com/meta/original/3X/d/f/df8bd4a0c3500283915c83b7f1abf0c512cf878f.png)

(«нет категории» в выпадающем меню — это явно неудачное описание того, что оно на самом деле означает. Я исправлю это).

> [@Clint\_Dovholuk](#):
>
> Я уже публиковал скриншот от команды со слэшем. Публикую его здесь снова… вы можете видеть, что «подкатегории» не перечислены в сообщении или двух выше…

Я думаю, что подкатегории опущены в тексте справки для экономии места. Но вы всё равно можете подписываться на категории, используя их «слэг» (название подкатегории из URL). Так, в случае с #howto:admins здесь, на Meta, это будет `/discourse watch admins`.

[Следующая страница](https://meta.discourse.org/t/set-up-mattermost-notifications-using-the-discourse-chat-integration-plugin/66811.md?page=2)
