mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-08-18 16:48:48 +02:00
global-functions: $SendEMail: handle signature with $IfThenElse
This commit is contained in:
parent
b078ce2f0f
commit
46866e2ff2
1 changed files with 4 additions and 4 deletions
|
@ -719,6 +719,7 @@
|
||||||
:global EmailGeneralCc;
|
:global EmailGeneralCc;
|
||||||
|
|
||||||
:global LogPrintExit;
|
:global LogPrintExit;
|
||||||
|
:global IfThenElse;
|
||||||
|
|
||||||
:if ([ :len $EmailGeneralTo ] = 0) do={
|
:if ([ :len $EmailGeneralTo ] = 0) do={
|
||||||
:return false;
|
:return false;
|
||||||
|
@ -726,12 +727,11 @@
|
||||||
|
|
||||||
:do {
|
:do {
|
||||||
:local Signature [ / system note get note ];
|
:local Signature [ / system note get note ];
|
||||||
:if ([ :len $Signature ] > 0) do={
|
|
||||||
:set Signature ("\n-- \n" . $Signature);
|
|
||||||
}
|
|
||||||
/ tool e-mail send to=$EmailGeneralTo cc=$EmailGeneralCc \
|
/ tool e-mail send to=$EmailGeneralTo cc=$EmailGeneralCc \
|
||||||
subject=("[" . $Identity . "] " . $Subject) \
|
subject=("[" . $Identity . "] " . $Subject) \
|
||||||
body=($Message . $Signature) file=$Attach;
|
body=($Message . \
|
||||||
|
[ $IfThenElse ([ :len $Signature ] > 0) ("\n-- \n" . $Signature) "" ]) \
|
||||||
|
file=$Attach;
|
||||||
} on-error={
|
} on-error={
|
||||||
$LogPrintExit warning ("Failed sending notification mail!") false;
|
$LogPrintExit warning ("Failed sending notification mail!") false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue