diff --git a/lgsm/functions/alert.sh b/lgsm/functions/alert.sh index 162b296eb..83280c31f 100755 --- a/lgsm/functions/alert.sh +++ b/lgsm/functions/alert.sh @@ -176,6 +176,17 @@ elif [ -z "${pushovertoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then fn_script_error "Pushover token not set" fi +if [ "${sendgridalert}" == "on" ]&&[ -n "${sendgridalert}" ]; then + alert_sendgrid.sh +elif [ "${sendgridalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_warn_nl "SendGrid alerts not enabled" + fn_script_log_warn "SendGrid alerts not enabled" +elif [ -z "${sendgridtoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "SendGrid token not set" + echo -e "* https://docs.linuxgsm.com/alerts/sendgrid" + fn_script_error "SendGrid token not set" +fi + if [ "${telegramalert}" == "on" ]&&[ -n "${telegramtoken}" ]; then alert_telegram.sh elif [ "${telegramalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then