aboutsummaryrefslogtreecommitdiffstats
path: root/global-functions
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2021-04-27 21:20:02 +0200
committerGravatar Christian Hesse <mail@eworm.de>2021-04-28 13:58:37 +0200
commit42dcdae11eb5d3dcb25c07e2bb790b2c7851a785 (patch)
tree31b321e63d38da9e5881815deed372069634abda /global-functions
parente97b3945363c8f322b7ff7f4bf65f13d887d373b (diff)
global-functions: $SendEMail2: support overriding to and cc
Diffstat (limited to 'global-functions')
-rw-r--r--global-functions10
1 files 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")) "" ] . \