On this loop
Code: Select all
:foreach tagContent in=$smsList do={
:local index [($tokenParser->"getTag") source=$tagContent tag="Index"]
:local phone [($tokenParser->"getTag") source=$tagContent tag="Phone"]
:local content [($tokenParser->"getTag") source=$tagContent tag="Content"]
:local read ([($tokenParser->"getTag") source=$tagContent tag="Smstat"] = 1)
:if ($content != "") do={
/tool e-mail send to=to@mail.com subject="SMS List" body="$index $read $phone $content"
# :put "$index $read $phone $content"
}
}
if I execute the ":put" I get this result:
[admin@Mikrotik] > sys scr run test-sms
40001 false +34XXXXXXXXX Lorem ipsum 2
40000 false +34XXXXXXXXX Lorem ipsum 1
If I execute the email, I get the following, i.e. it sends me an email for each line.
Email2:
SMS List
40001 false +34XXXXXXXXX Lorem ipsum 2
Email1:
SMS List
40000 false +34XXXXXXXXX Lorem ipsum 1
I would like to know how I can get the two lines (or three, four, etc) in a SINGLE email.
Single email:
SMS List
40001 false +34XXXXXXXXX Lorem ipsum 2
40000 false +34XXXXXXXXX Lorem ipsum 1
Is it possible? Thanks.
BR.