mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
global-functions: $SendEMail2: support overriding to and cc
This commit is contained in:
parent
e97b394536
commit
42dcdae11e
1 changed files with 8 additions and 2 deletions
|
@ -894,14 +894,20 @@
|
||||||
|
|
||||||
:global Identity;
|
:global Identity;
|
||||||
:global EmailGeneralTo;
|
:global EmailGeneralTo;
|
||||||
|
:global EmailGeneralToOverride;
|
||||||
:global EmailGeneralCc;
|
:global EmailGeneralCc;
|
||||||
|
:global EmailGeneralCcOverride;
|
||||||
:global EmailQueue;
|
:global EmailQueue;
|
||||||
|
|
||||||
|
:global EitherOr;
|
||||||
:global IfThenElse;
|
:global IfThenElse;
|
||||||
:global LogPrintExit2;
|
:global LogPrintExit2;
|
||||||
:global QuotedPrintable;
|
: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;
|
:return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -910,7 +916,7 @@
|
||||||
}
|
}
|
||||||
:local Signature [ / system note get note ];
|
:local Signature [ / system note get note ];
|
||||||
:set ($EmailQueue->[ :len $EmailQueue ]) {
|
:set ($EmailQueue->[ :len $EmailQueue ]) {
|
||||||
to=$EmailGeneralTo; cc=$EmailGeneralCc;
|
to=$To; cc=$Cc;
|
||||||
subject=[ $QuotedPrintable ("[" . $Identity . "] " . ($Notification->"subject")) ];
|
subject=[ $QuotedPrintable ("[" . $Identity . "] " . ($Notification->"subject")) ];
|
||||||
body=(($Notification->"message") . \
|
body=(($Notification->"message") . \
|
||||||
[ $IfThenElse ([ :len ($Notification->"link") ] > 0) ("\n\n" . ($Notification->"link")) "" ] . \
|
[ $IfThenElse ([ :len ($Notification->"link") ] > 0) ("\n\n" . ($Notification->"link")) "" ] . \
|
||||||
|
|
Loading…
Reference in a new issue