88# #####################
99# SCRIPT VARIABLES #
1010# #####################
11- SNAPSCRIPTVERSION=" 3.4" # DEV10
11+ SNAPSCRIPTVERSION=" 3.4" # DEV11
1212
1313# Read SnapRAID version
1414SNAPRAIDVERSION=" $( snapraid -V | sed -e ' s/snapraid v\(.*\)by.*/\1/' ) "
399399 echo " ## Total time elapsed for SnapRAID: $ELAPSED "
400400 mklog " INFO: Total time elapsed for SnapRAID: $ELAPSED "
401401 # if email or hook service are enabled, will be sent now
402- if [ " $EMAIL_ADDRESS " ] || [ -x " $HOOK_NOTIFICATION " ] || [ " $HEALTHCHECKS " -eq 1 ] || [ " $TELEGRAM " -eq 1 ] || [ " $DISCORD " -eq 1 ]; then
402+ if [ " $EMAIL_ADDRESS " ] || [ -x " $HOOK_NOTIFICATION " ] || [ " $APPRISE_EMAIL " -eq 1 ] || [ " $ HEALTHCHECKS" -eq 1 ] || [ " $TELEGRAM " -eq 1 ] || [ " $DISCORD " -eq 1 ]; then
403403 # Add a topline to email body and send a long mail
404404 sed_me " 1s:^:##$SUBJECT \n:" " ${TMP_OUTPUT} "
405405 # send long mail if verbosity is set to 1
@@ -1024,6 +1024,9 @@ function send_mail(){
10241024if [ -x " $HOOK_NOTIFICATION " ]; then
10251025 echo -e " Notification user script is set. Calling it now [$( date) ]"
10261026 $HOOK_NOTIFICATION " $SUBJECT " " $body "
1027+ elif [ " $APPRISE_EMAIL " -eq 1 ]; then
1028+ echo " Sending email report using Apprise service."
1029+ " $APPRISE_BIN " -vv -i " html" -t " $SUBJECT " -b " $body " \ " $APPRISE_EMAIL_URL "
10271030elif [ " $EMAIL_ADDRESS " ]; then
10281031 echo -e " Email address is set. Sending email report to **$EMAIL_ADDRESS ** [$( date) ]"
10291032 if [ -z " $MAIL_BIN " ]; then
@@ -1050,8 +1053,8 @@ elif [ "$EMAIL_ADDRESS" ]; then
10501053 $MAIL_BIN -a ' Content-Type: text/html; charset=UTF-8' -s " $SUBJECT " -r " $FROM_EMAIL_ADDRESS " " $EMAIL_ADDRESS " \
10511054 < <( echo " $body " )
10521055 fi
1053- fi
1054- fi
1056+ fi
1057+ fi
10551058fi
10561059
10571060}
0 commit comments