How to send SMS with message body 'hotspot active count and user list only'

i am using hotspot service of ROS. i want to send SMS to my phone by using a script in ROS. SMS body will be as below.

“total active user: 5, User online: adam, karlos, jui, mohammad, wasim”

how to write the script?

thanks,
wahid

BELOW SCRIPT IS NOT WORKING…

/tool sms send usb4 01823555556 message=“$[:foreach int in=[/ip hotspot active find] do={:put [/ip hotspot active get $int user]}]”

suppose 3 user active in hotspot it generate 3 message for 3 user if i use below script.

msg1 inbox: mike
msg2 inbox: adam
msg3 inbox: jack


:foreach a in=[/ip hotspot active find] do={/tool sms send usb4 01823555556 message=“$[/ip hotspot active get $a user]”}



but i want total active users in a single message as below format.
“total active user: 5, User online: adam, karlos, jui, mohammad, wasim”

how to write the script? please help me expert…

if i use below script

:foreach a in=[/ip hotspot active find] do={/tool sms send usb4 01823555556 message=“$[/ip hotspot active get $a user], $[/ip hotspot active get $a user], $[/ip hotspot active get $a user]”}

it show as below

msg1 inbox: mike, mike, mike
msg2 inbox: adam, adam, adam
msg3 inbox: jack, jack, jack