snapraid-aio-script icon indicating copy to clipboard operation
snapraid-aio-script copied to clipboard

Send E-Mail only on error

Open Klar opened this issue 1 year ago • 1 comments

Is there a configuration for only sending out the E-Mail if something is wrong?

As I am using healtchecks.io I would get notified if something is wrong with the script.

Klar avatar Jul 25 '24 14:07 Klar

Hi, this is not possible at the moment, but I can try to add this. I'll keep you posted here.

auanasgheps avatar Jul 31 '24 10:07 auanasgheps

maybe something like

# 1 to enable, any other value to disable.
MAIL_SUCCESS=0
if [ "$VERBOSITY" -eq 1 ]; then
  send_mail < "$TMP_OUTPUT"
else
# or send a short mail if enabled on success
  if [ "$MAIL_SUCCESS" -eq 1 ]; then
    trim_log < "$TMP_OUTPUT" | send_mail
  fi
fi

Klar avatar Dec 01 '24 10:12 Klar

I will keep the email report on every run, so I won't implement this, but there are some alternatives after the latest changes I've made.

With Apprise notification service you'll get more flexibily with the notification service you want to use, plus the full report attached either in a supported service or email.

auanasgheps avatar Apr 20 '25 10:04 auanasgheps