From 45a8bdbedca4cca3e2a1f46763798b11d698def9 Mon Sep 17 00:00:00 2001 From: neilpang Date: Mon, 29 Apr 2019 21:07:04 +0800 Subject: [PATCH] fix format --- notify/mailgun.sh | 3 ++- notify/sendgrid.sh | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/notify/mailgun.sh b/notify/mailgun.sh index c1085a74..1689a0b9 100644 --- a/notify/mailgun.sh +++ b/notify/mailgun.sh @@ -16,6 +16,7 @@ mailgun_send() { _subject="$1" _content="$2" _statusCode="$3" #0: success, 1: error 2($RENEW_SKIP): skipped + _debug "_statusCode" "$_statusCode" MAILGUN_API_KEY="${MAILGUN_API_KEY:-$(_readaccountconf_mutable MAILGUN_API_KEY)}" if [ -z "$MAILGUN_API_KEY" ]; then @@ -112,7 +113,7 @@ _mailgun_rest() { response="$(_post "$_mgdata" "$_mgurl" "" "$_method")" fi if [ "$?" != "0" ]; then - _err "Error: $ep" + _err "Error: $_mguri" _err "$response" return 1 fi diff --git a/notify/sendgrid.sh b/notify/sendgrid.sh index bd04155a..5c5bfdba 100644 --- a/notify/sendgrid.sh +++ b/notify/sendgrid.sh @@ -10,6 +10,7 @@ sendgrid_send() { _subject="$1" _content="$2" _statusCode="$3" #0: success, 1: error 2($RENEW_SKIP): skipped + _debug "_statusCode" "$_statusCode" SENDGRID_API_KEY="${SENDGRID_API_KEY:-$(_readaccountconf_mutable SENDGRID_API_KEY)}" if [ -z "$SENDGRID_API_KEY" ]; then @@ -41,7 +42,7 @@ 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." @@ -50,6 +51,6 @@ sendgrid_send() { fi _err "sendgrid send error." _err "$response" - return 1; + return 1 }