aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2021-04-29 16:22:04 +0200
committerGravatar Christian Hesse <mail@eworm.de>2021-04-29 22:37:36 +0200
commit529cefffafca2dedd93f48303db73805d965431f (patch)
tree18bb980f61c757b2cfb78c3ce24fb61abbb846ce
parentc2b45a90934e4860652dce0022a0a4081588391d (diff)
global-functions: $SendEMail2: support file attachments
-rw-r--r--global-functions8
1 files changed, 5 insertions, 3 deletions
diff --git a/global-functions b/global-functions
index 65c9721..a1a070c 100644
--- a/global-functions
+++ b/global-functions
@@ -332,6 +332,7 @@
:set FlushEmailQueue do={
:global EmailQueue;
+ :global EitherOr;
:global LogPrintExit2;
:local AllDone true;
@@ -345,8 +346,8 @@
:foreach Id,Message in=$EmailQueue do={
:if ([ :typeof $Message ] = "array" ) do={
- / tool e-mail send to=($Message->"to") cc=($Message->"cc") \
- subject=($Message->"subject") body=($Message->"body");
+ / tool e-mail send to=($Message->"to") cc=($Message->"cc") subject=($Message->"subject") \
+ body=($Message->"body") file=[ $EitherOr ($Message->"attach") "" ];
:local Wait true;
:do {
:delay 1s;
@@ -924,7 +925,8 @@
subject=[ $QuotedPrintable ("[" . $Identity . "] " . ($Notification->"subject")) ];
body=(($Notification->"message") . \
[ $IfThenElse ([ :len ($Notification->"link") ] > 0) ("\n\n" . ($Notification->"link")) "" ] . \
- [ $IfThenElse ([ :len $Signature ] > 0) ("\n-- \n" . $Signature) "" ]) };
+ [ $IfThenElse ([ :len $Signature ] > 0) ("\n-- \n" . $Signature) "" ]); \
+ attach=($Notification->"attach") };
:if ([ :len [ / system scheduler find where name="FlushEmailQueue" ] ] = 0) do={
/ system scheduler add name=FlushEmailQueue interval=1s start-time=startup \
on-event=":global FlushEmailQueue; \$FlushEmailQueue;";