mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2025-02-09 13:46:58 +02:00
Fixed POST to webhook
This commit is contained in:
parent
b83841d253
commit
b6b399a590
@ -167,14 +167,13 @@ function notify_error() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
WEBHOOK_BODY=$(echo ${WATCHDOG_NOTIFY_WEBHOOK_BODY} | sed "s/\$SUBJECT\|\${SUBJECT}/$SUBJECT/g" | sed "s/\$BODY\|\${BODY}/$BODY/" | sed "s/\"/\\\\\"/g")
|
# Replace subject and body placeholders
|
||||||
|
WEBHOOK_BODY=$(echo ${WATCHDOG_NOTIFY_WEBHOOK_BODY} | sed "s/\$SUBJECT\|\${SUBJECT}/$SUBJECT/g" | sed "s/\$BODY\|\${BODY}/$BODY/")
|
||||||
|
|
||||||
|
# POST to webhook
|
||||||
|
curl -X POST -H "Content-Type: application/json" -d "${WEBHOOK_BODY}" ${WATCHDOG_NOTIFY_WEBHOOK}
|
||||||
|
|
||||||
curl -X POST \
|
log_msg "Sent notification using webhook"
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d ${WEBHOOK_BODY} \
|
|
||||||
${WATCHDOG_NOTIFY_WEBHOOK}
|
|
||||||
|
|
||||||
log_msg "Posted notification to webhook"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user