diff --git a/home.admin/XXsendNotification.py b/home.admin/XXsendNotification.py index 72ecd833c..808f2ed69 100644 --- a/home.admin/XXsendNotification.py +++ b/home.admin/XXsendNotification.py @@ -107,7 +107,7 @@ def mail(recipient: str = None, message: str = None, subject: str = None, cert: 'From: {} <{}>'.format(from_name, from_address), "Subject: {}".format(subject), "", - "{}".format(message) + "{}".format(message.encode('utf8')) ] with open(cert, 'rb') as pem: @@ -122,7 +122,7 @@ def mail(recipient: str = None, message: str = None, subject: str = None, cert: msg['From'] = '{} <{}>'.format(from_name, from_address), msg['To'] = recipient - msg.set_payload(message) + msg.set_payload(message.encode('utf8')) msg_to_send = msg.as_bytes() # send message via e-Mail diff --git a/home.admin/config.scripts/blitz.notify.sh b/home.admin/config.scripts/blitz.notify.sh index 4a3c1041e..a14bd5b0a 100755 --- a/home.admin/config.scripts/blitz.notify.sh +++ b/home.admin/config.scripts/blitz.notify.sh @@ -146,9 +146,9 @@ if [ "$1" = "send" ]; then /usr/bin/python3 /home/admin/XXsendNotification.py ext ${notifyExtCmd} "$2" elif [ "${notifyMethod}" = "mail" ]; then if [ "${notifyMailEncrypt}" = "on" ]; then - /usr/bin/python3 /home/admin/XXsendNotification.py mail "${@:3}" --from-address "${notifyMailFromAddress}" --from-name "${notifyMailFromName}" --cert "${notifyMailToCert}" --encrypt ${notifyMailTo} "$2" + /usr/bin/python3 /home/admin/XXsendNotification.py mail --from-address "${notifyMailFromAddress}" --from-name "${notifyMailFromName}" --cert "${notifyMailToCert}" --encrypt ${notifyMailTo} "${@:3}" "$2" else - /usr/bin/python3 /home/admin/XXsendNotification.py mail "${@:3}" --from-address "${notifyMailFromAddress}" --from-name "${notifyMailFromName}" "${notifyMailTo}" "$2" + /usr/bin/python3 /home/admin/XXsendNotification.py mail --from-address "${notifyMailFromAddress}" --from-name "${notifyMailFromName}" "${notifyMailTo}" "${@:3}" "$2" fi elif [ "${notifyMethod}" = "slack" ]; then /usr/bin/python3 /home/admin/XXsendNotification.py slack -h "$2"