The playbook can install and configure matrix-appservice-webhooks for you.
Setup Instructions:
loosely based on this
All you basically need is to adjust your inventory/host_vars/matrix.<domain-name>/vars.yml:
matrix_appservice_webhooks_enabled: true
matrix_appservice_webhooks_api_secret: '<your_secret>'
In case you want to change the verbosity of logging via journalctl -fu matrix-appservice-webhooks.service
you can adjust this in inventory/host_vars/matrix.<domain-name>/vars.yml as well.
Note: default value is: info and availabe log levels are : info, verbose
matrix_appservice_webhooks_log_level: '<log_level>'
If you’ve already installed Matrix services using the playbook before, you’ll need to re-run it (--tags=setup-all,start). If not, proceed with configuring other playbook services and then with Installing. Get back to this guide once ready.
Invite the bridge bot user to your room:
/invite @_webhook:<domain.name>
Note: Make sure you have administration permissions in your room
Send a message to the bridge bot in order to receive a private message including the webhook link.
!webhook
The JSON body for posting messages will have to look like this:
{
"text": "Hello world!",
"format": "plain",
"displayName": "My Cool Webhook",
"avatarUrl": "http://i.imgur.com/IDOBtEJ.png"
}
curl --header "Content-Type: application/json" \
--data '{
"text": "Hello world!",
"format": "plain",
"displayName": "My Cool Webhook",
"avatarUrl": "http://i.imgur.com/IDOBtEJ.png"
}' \
<the link you've gotten in 5.>