Matrix notification agent


Recommended Posts

The ability to have Matrix as a notification agent would be great.

Also having a section for custom agents.

 

An example script to send a message to Matrix room (inc E2EE) 1 2

#!/bin/bash

# https://gist.github.com/RickCogley/69f430d4418ae5498e8febab44d241c9
# https://gist.github.com/travnewmatic/769cd9532504e0f85983d69acd4a7d29
#
# Get Access Token
# curl -XPOST -d '{"type":"m.login.password", "user":"***your_username***", "password":"***your_password***"}' "https://matrix.org/_matrix/client/r0/login"

msgtype=m.text
homeserver=<homeserver>
room=<room>
accesstoken=<accesstoken>
 
#Piped Version
#curl -XPOST -d "$( jq -Rsc --arg msgtype "$msgtype" '{$msgtype, body:.}')" -H 'Authorization: Bearer $accesstoken' "https://$homeserver/_matrix/client/r0/rooms/$room/send/m.room.message"

#Arg Version
curl -XPOST -d '{'\"msgtype\":\"$msgtype\"', '\"body\"':'\""$*"\"'}' -H 'Authorization: Bearer $accesstoken' "https://$homeserver/_matrix/client/r0/rooms/$room/send/m.room.message"

#RichText Version
#curl -XPOST -d '{"msgtype":"m.text", "body":"**Hello**","format":"org.matrix.custom.html","formatted_body":"<strong>hello</strong>"}' -H 'Authorization: Bearer $accesstoken' "https://$homeserver/_matrix/client/r0/rooms/$room/send/m.room.message"

 

Edited by CorvinusLucian
duplicate access token in piped url
  • Like 1
  • Upvote 2
Link to comment
  • 1 month later...
  • 3 months later...
  • 5 months later...
  • 3 months later...

Oh just to let you know, I've implemented Pushbits notifications into Unraid which is a notification agent for Matrix-Synapse.

 

Pushbits is based on the Gotify API and is working really well with Unraid.

 

You can find the Docker container also in the CA App.

 

& @kardinal

 

EDIT: It looks something like that in the Unraid GUI:

grafik.thumb.png.bdb38e3666ab5bfa2e33c4061dd02b21.png

 

And if you click test you get this:

grafik.png.55d5e58bc9cbee56a1b2bd9aa9dafad0.png

 

The notifications are also color coded for Normal, Warning and Alert messages if enabled in Pushbits.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.