global-functions: $SendEMail: invert condition

This commit is contained in:
Christian Hesse 2020-03-05 10:57:47 +01:00
parent 227151e189
commit 3d07ebde05

View file

@ -389,18 +389,20 @@
:global EmailGeneralTo;
:global EmailGeneralCc;
:if ([ :len $EmailGeneralTo ] > 0) do={
: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;
} on-error={
:log warning "Failed sending notification mail!";
:if ([ :len $EmailGeneralTo ] = 0) do={
:return;
}
: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;
} on-error={
:log warning "Failed sending notification mail!";
}
}