From e1fc242f4ea06bcc2d6deaf1dbc86522e6080897 Mon Sep 17 00:00:00 2001 From: Linux User Date: Sun, 8 Nov 2020 00:08:50 +0000 Subject: [PATCH] send result by email --- add_todo.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/add_todo.sh b/add_todo.sh index 317a553..b4bbcb4 100755 --- a/add_todo.sh +++ b/add_todo.sh @@ -31,6 +31,7 @@ if [ "$_task_id" != null ] ; then echo "Task created: $_task_id" else echo "Error: $_result" + printf "Subject: Fail: Todo: '%s'\n\n%s\n----------------------\n%s" "$_title" "$_result" "$_description" | sendmail -f server@gabbaell.co.uk kanboard.docker@gabbaell.co.uk exit 6 fi @@ -42,7 +43,9 @@ _result="$(curl --user $_api_auth \ _status="$(echo "$_result" | jq '.result')" if [ "$_status" = true ] ; then echo "Task moved: $_status" + printf "Subject: OK: Todo: '%s'\n\n%s" "$_title" "$_description" | sendmail -f server@gabbaell.co.uk kanboard.docker@gabbaell.co.uk else echo "Error: $_result" + printf "Subject: Fail: Todo: '%s'\n\n%s\n----------------------\n%s" "$_title" "$_result" "$_description" | sendmail -f server@gabbaell.co.uk kanboard.docker@gabbaell.co.uk exit 9 fi