From 46866e2ff232c86b62419810667a3a394a2b4b65 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 26 Nov 2020 22:34:08 +0100 Subject: global-functions: $SendEMail: handle signature with $IfThenElse --- global-functions | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'global-functions') diff --git a/global-functions b/global-functions index ac7cec1..be04150 100644 --- a/global-functions +++ b/global-functions @@ -719,6 +719,7 @@ :global EmailGeneralCc; :global LogPrintExit; + :global IfThenElse; :if ([ :len $EmailGeneralTo ] = 0) do={ :return false; @@ -726,12 +727,11 @@ :do { :local Signature [ / system note get note ]; - :if ([ :len $Signature ] > 0) do={ - :set Signature ("\n-- \n" . $Signature); - } / tool e-mail send to=$EmailGeneralTo cc=$EmailGeneralCc \ subject=("[" . $Identity . "] " . $Subject) \ - body=($Message . $Signature) file=$Attach; + body=($Message . \ + [ $IfThenElse ([ :len $Signature ] > 0) ("\n-- \n" . $Signature) "" ]) \ + file=$Attach; } on-error={ $LogPrintExit warning ("Failed sending notification mail!") false; } -- cgit v1.2.3-70-g09d2