From 42dcdae11eb5d3dcb25c07e2bb790b2c7851a785 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 27 Apr 2021 21:20:02 +0200 Subject: global-functions: $SendEMail2: support overriding to and cc --- global-functions | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/global-functions b/global-functions index 48b58a6..e32a66e 100644 --- a/global-functions +++ b/global-functions @@ -894,14 +894,20 @@ :global Identity; :global EmailGeneralTo; + :global EmailGeneralToOverride; :global EmailGeneralCc; + :global EmailGeneralCcOverride; :global EmailQueue; + :global EitherOr; :global IfThenElse; :global LogPrintExit2; :global QuotedPrintable; - :if ([ :len $EmailGeneralTo ] = 0) do={ + :local To [ $EitherOr ($EmailGeneralToOverride->($Notification->"origin")) $EmailGeneralTo ]; + :local Cc [ $EitherOr ($EmailGeneralCcOverride->($Notification->"origin")) $EmailGeneralCc ]; + + :if ([ :len $To ] = 0) do={ :return false; } @@ -910,7 +916,7 @@ } :local Signature [ / system note get note ]; :set ($EmailQueue->[ :len $EmailQueue ]) { - to=$EmailGeneralTo; cc=$EmailGeneralCc; + to=$To; cc=$Cc; subject=[ $QuotedPrintable ("[" . $Identity . "] " . ($Notification->"subject")) ]; body=(($Notification->"message") . \ [ $IfThenElse ([ :len ($Notification->"link") ] > 0) ("\n\n" . ($Notification->"link")) "" ] . \ -- cgit v1.2.3-54-g00ecf