From c09e813aad09512a7b0a4abd99f172940c0fadad Mon Sep 17 00:00:00 2001 From: Alireza <5110480+silverbios@users.noreply.github.com> Date: Sat, 10 Feb 2024 20:47:36 +0330 Subject: [PATCH] Update notify_matrix.sh Fix Msgbody variable syntax --- notify_matrix.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notify_matrix.sh b/notify_matrix.sh index 5f76a32..b69320a 100644 --- a/notify_matrix.sh +++ b/notify_matrix.sh @@ -19,10 +19,10 @@ send_notification() { AccessToken="Your Matrix token here" Room_id="Enter Room_id here" MatrixServer="Enter Your HomeServer URL" - MsgBody="{msgtype":"m.text","body":"$MessageBody"}" + MsgBody="{\"msgtype\":\"m.text\",\"body\":\"$MessageBody\"}" # URL Example: https://matrix.org/_matrix/client/r0/rooms/!xxxxxx:example.com/send/m.room.message/?access_token=xxxxxxxx - curl -sS -o /dev/null --fail -X PUT "$MatrixServer/_matrix/client/r0/rooms/$Room_id/send/m.room.message/?access_token=$AccessToken" -H 'Content-Type: application/json' -d "$MsgBody" + curl -sS -o /dev/null --fail -X PUT "$MatrixServer/_matrix/client/r0/rooms/$Room_id/send/m.room.message?access_token=$AccessToken" -H 'Content-Type: application/json' -d "$MsgBody" }