1
0
mirror of https://github.com/eworm-de/routeros-scripts.git synced 2024-05-11 05:55:19 +00:00

mod/notification-email: convert to array earlier

This commit is contained in:
Christian Hesse
2022-11-17 22:13:02 +01:00
parent 9f02f04334
commit 71d1f2a781

View File

@ -43,7 +43,7 @@
:foreach Id,Message in=$EmailQueue do={
:if ([ :typeof $Message ] = "array" ) do={
:local Attach [ $EitherOr ($Message->"attach") "" ];
:local Attach [ :toarray [ $EitherOr ($Message->"attach") "" ] ];
:while ([ /tool/e-mail/get last-status ] = "in-progress") do={ :delay 1s; }
/tool/e-mail/send to=($Message->"to") cc=($Message->"cc") subject=($Message->"subject") \
body=($Message->"body") file=$Attach;
@ -55,7 +55,7 @@
:set ($EmailQueue->$Id);
:set Wait false;
:if (($Message->"remove-attach") = true) do={
:foreach File in=[ :toarray $Attach ] do={
:foreach File in=$Attach do={
/file/remove $File;
}
}