mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
global-functions: $SendEMail2: support overriding to and cc
This commit is contained in:
@ -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")) "" ] . \
|
||||
|
Reference in New Issue
Block a user