mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-12-24 03:52:10 +08:00
fix notify message
This commit is contained in:
@@ -73,13 +73,13 @@ ifttt_send() {
|
||||
_subject=$(echo "$_subject" | _json_encode)
|
||||
_data="{\"$IFTTT_SUBJECT_KEY\": \"$_subject\", \"$IFTTT_CONTENT_KEY\": \"$_content\"}"
|
||||
|
||||
response="" #just make shellcheck happy
|
||||
if _post "$_data" "$IFTTT_API_URL" "" "POST" "application/json"; then
|
||||
if _contains "$response" "Congratulations"; then
|
||||
_info "IFTTT webhooks event fired success."
|
||||
return 0
|
||||
fi
|
||||
response="$(_post "$_data" "$IFTTT_API_URL" "" "POST" "application/json")"
|
||||
|
||||
if [ "$?" = "0" ] && _contains "$response" "Congratulations"; then
|
||||
_info "IFTTT webhooks event fired success."
|
||||
return 0
|
||||
fi
|
||||
|
||||
_err "IFTTT webhooks event fired error."
|
||||
_err "$response"
|
||||
return 1
|
||||
|
||||
@@ -50,13 +50,13 @@ pushover_send() {
|
||||
_subject="$(printf "*%s*\n" "$_subject" | _json_encode)"
|
||||
_data="{\"token\": \"$PUSHOVER_TOKEN\",\"user\": \"$PUSHOVER_USER\",\"title\": \"$_subject\",\"message\": \"$_content\",\"sound\": \"$PUSHOVER_SOUND\", \"device\": \"$PUSHOVER_DEVICE\", \"priority\": \"$PUSHOVER_PRIORITY\"}"
|
||||
|
||||
response="" #just make shellcheck happy
|
||||
if _post "$_data" "$PUSHOVER_URI"; then
|
||||
if _contains "$response" "{\"status\":1"; then
|
||||
_info "PUSHOVER send success."
|
||||
return 0
|
||||
fi
|
||||
response="$(_post "$_data" "$PUSHOVER_URI")"
|
||||
|
||||
if [ "$?" = "0" ] && _contains "$response" "{\"status\":1"; then
|
||||
_info "PUSHOVER send success."
|
||||
return 0
|
||||
fi
|
||||
|
||||
_err "PUSHOVER send error."
|
||||
_err "$response"
|
||||
return 1
|
||||
|
||||
@@ -42,13 +42,13 @@ sendgrid_send() {
|
||||
|
||||
_content="$(echo "$_content" | _json_encode)"
|
||||
_data="{\"personalizations\": [{\"to\": [{\"email\": \"$SENDGRID_TO\"}]}],\"from\": {\"email\": \"$SENDGRID_FROM\"},\"subject\": \"$_subject\",\"content\": [{\"type\": \"text/plain\", \"value\": \"$_content\"}]}"
|
||||
response="" #just make shellcheck happy
|
||||
if _post "$_data" "https://api.sendgrid.com/v3/mail/send"; then
|
||||
if [ -z "$response" ]; then
|
||||
_info "sendgrid send sccess."
|
||||
return 0
|
||||
fi
|
||||
response="$(_post "$_data" "https://api.sendgrid.com/v3/mail/send")"
|
||||
|
||||
if [ "$?" = "0" ] && [ -z "$response" ]; then
|
||||
_info "sendgrid send sccess."
|
||||
return 0
|
||||
fi
|
||||
|
||||
_err "sendgrid send error."
|
||||
_err "$response"
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user