Click on "Integrations" > "Incoming Webhooks" > "Add Incoming Webhooks"
Write a message to the default channel:
curl -i -X POST -H 'Content-Type: application/json' \
-d '{"text": "Hello, World!"}' \
https://your-mattermost-server.com/hooks/GENERATED-KEY
Note the "BOT" tag!
Write a message to a different channel than the default:
curl -i -X POST -H 'Content-Type: application/json' \
-d '{"text": "Hello, World!", "channel": "CHANNEL-NAME" }' \
https://your-mattermost-server.com/hooks/GENERATED-KEY
Write a message with additional content:
curl -i -X POST -H 'Content-Type: application/json' \
-d '{"text": "Hello, World!", "props": { "card": "Card demo content." } }'\
https://chat.canonical.com/hooks/GENERATED-KEY
See the official doumnetation for more details.
For example: Official Mattermost Github Action
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Create the Mattermost Message
run: |
echo "{\"text\":\"testing github action :tada:\"}" > mattermost.json
- uses: mattermost/action-mattermost-notify@master
env:
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
For example: 3rd Party Mattermost Extension
.vscode/settings.json
:
{
"mattermost":
{
"channels":
[
{
"name": "Canonical",
"url": "https://chat.canonical.com/hooks/GENERATED-KEY"
}
]
}
}