Richten Sie Mattermost-Benachrichtigungen mit dem discourse-chat-integration-Plugin ein

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

Install

If you haven’t already, install the discourse-chat-integration plugin

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:

    • Enable Incoming Webhooks
    • Enable integrations to override usernames
    • Enable integrations to override profile picture icons
    • Enable Custom Slash Commands (if you want slash commands)
  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)

  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 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:
    26

  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

    • Display Name: Discourse
    • Description: Manage Discourse notification rules
    • Command Trigger Word: discourse
    • Request URL: <your-discourse-url>/chat-integration/mattermost/command
    • Request Method: POST
    • Response Username: Discourse
    • Response Icon: (optionally specify an icon URL)
    • Autocomplete: :ballot_box_with_check:
    • Autocomplete Hint: Manage this channel's integration with Discourse
    • Autocomplete Description: [watch|follow|mute|delete|status|help]
  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. :1st_place_medal:

Last edited by @JammyDodger 2024-05-26T07:09:54Z

Check documentPerform check on document:
11 „Gefällt mir“

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

and probably a dedicated topic.

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

6 „Gefällt mir“

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

1 „Gefällt mir“

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

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

5 „Gefällt mir“

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

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

Any tips on how to fix it?

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 :wink:

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

https://github.com/discourse/discourse-chat-integration/commit/438a9d92fe6be632b825238ce703a03dd20d285b

2 „Gefällt mir“

Hi David didnt work unfortunately

Are you sure it is not an issue with mattermost_provider.rb:68 ?

Thanks

Vedat

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 :slight_smile:

1 „Gefällt mir“

Thanks! All set now :slight_smile:

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

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 „Gefällt mir“

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

Ich habe die Chat-Integration mit Mattermost aktiviert – ich habe alle „Top-Level“-Kategorien abonniert, die über den Befehl „/discourse watch“ angezeigt werden, aber Beiträge zu „Unterkategorien“ werden nicht erfasst.

Nehmen Sie diesen Beitrag: https://openziti.discourse.group/t/this-is-a-test-topic-in-the-sdks-category/271
Er wird ordnungsgemäß an Slack weitergeleitet – aber NICHT an Mattermost. Slack kann „alle Kategorien“ abonnieren. Mattermost scheint dazu nicht in der Lage zu sein.

Ich habe alle Syntax ausprobiert, die mir einfällt, aber ohne Erfolg. Irgendwelche Tipps??

Vielen Dank im Voraus…

1 „Gefällt mir“

@david – Entschuldigung für die Erwähnung, aber mir fehlen Discourse-Beiträge in meiner Chat-Integration. Hast du zufällig diesen Thread noch im Auge?

Derzeit werden Unterkategorien nicht automatisch einbezogen, wenn Sie eine Kategorie „beobachten“. Sie müssen entweder jede einzelne Unterkategorie hinzufügen oder die Option „Alle Kategorien“ verwenden.

1 „Gefällt mir“

Hallo, danke für die Antwort!!! Das wäre super, wenn ich herausfinden könnte, „wie“. Die einzigen Kategorien, die das Plugin zu erkennen scheint, sind die obersten Kategorien?

Ich habe die Option „Alle Kategorien“ gefunden/ausprobiert, aber auch das scheint nicht zu funktionieren? Mann, ich würde wirklich gerne einfach „alle“ verwenden, das wäre IDEAL… Mache ich es „falsch“? Siehe Screenshot unten

Hallo @david… das Problem mit dem oben genannten ist, dass ich nicht herausfinden kann, wie ich eine „Unterkategorie“ abonnieren kann, noch scheint es ein „Alle“ zu geben, das ich verwenden kann? Ich würde das gerne herausfinden.

Danke!

1 „Gefällt mir“

Entschuldigen Sie die verspätete Antwort @Clint_Dovholuk!

Mit Slash-Befehlen können Sie glaube ich alle Kategorien wie folgt beobachten:

/discourse watch

Der einfachste Weg, Benachrichtigungsregeln zu konfigurieren, ist jedoch über das Discourse-Admin-Panel. Dort sind alle Optionen übersichtlich in der Benutzeroberfläche angezeigt, sodass Sie nicht versuchen müssen, die genaue Syntax für den „Slash-Befehl“ herauszufinden. Weitere Informationen finden Sie im Abschnitt ‘Regeln konfigurieren’ der Dokumentation des Plugins.

2 „Gefällt mir“

Danke @david.

Ich habe zuvor einen Screenshot vom Slash-Befehl gepostet. Ich poste ihn hier erneut… Sie können sehen, dass die ‘Unterkategorien’ ein oder zwei Beiträge weiter oben nicht aufgeführt sind…

Ich hatte zuvor die Admin-Seite ausprobiert, aber sie schloss das Dropdown sofort, als ich sie benutzte… Das Drücken des ‘Pfeils nach unten’ schien jedoch das zu lockern, was ich brauchte.

Ich hätte WIRKLICH gerne eine ‘Alle’-Option. Ist das ein Plugin, das ich irgendwie bearbeiten/reparieren kann??? Im Moment sieht es so aus :confused:

Um Benachrichtigungen für alle Themen zu erhalten, empfehle ich, alle kategoriespezifischen Regeln zu löschen und dann eine einzige Regel für „alle Kategorien“ hinzuzufügen.

Können Sie mehr Details dazu geben, was Sie hier sehen? Screenshots oder ein Video wären großartig!

Beim Bearbeiten einer „Regel“ sollten Sie das Kategoriedropdown verwenden können, um „(keine Kategorie)“ auszuwählen.

Nach dem Speichern sollte es so aussehen:

(„keine Kategorie“ im Dropdown ist eine eindeutig schlechte Beschreibung dessen, was es tatsächlich bedeutet. Ich werde das beheben)

Ich glaube, Unterkategorien werden aus dem Hilfetext aus Platzgründen weggelassen. Sie können sich aber immer noch für Kategorien anmelden, indem Sie deren „Slug“ (den Namen der Unterkategorie aus der URL) verwenden. Im Fall von #howto:admins hier auf Meta wäre es also /discourse watch admins.