Hello,
I have Mikrotik routerOS v4.13 with hotspot setting.
I have activated “Advertise” in user profile for the users that didn’t pay for the internet. Advertise interval get shorter as days passed. But there are some people who only use only windows live messenger or open the browser for short time and download most of the time using a download manager program without saying the ADs to remind them to pay.
My only solution now to but time in advertise timeout but this way the internet will disconnect until they open the browser.
Is there a way so the user can get payment reminder even if they are not using the browser for long time.
If a user has not paid, you could set their profile to “NoPay”, for example.
As for a script, something like this:
:local Email
:local Name
:local Profile
/ip hotspot user {
:foreach u in=[find] do={
:set Email [get $u email]
:set Name [get $u name]
:set Profile [get $u profile]
# If user is in 'NoPay' profile, send them email
:if ($Profile = "NoPay") do={
# If user has an email address, send it
:if ([:len $Email] > 0) do={
:put ("Sending email to user: " . $Name . " email: " . $Email)
/tool e-mail send \
to=$Email \
subject="Pay up" \
body=("You have not paid for service. Send payment to xyz or email to: xyz for assistance") \
tls=(yes or no)
# If user does not have email address, log it
} else={
/log error ("NoPayment: User " . $Name . " has not paid, but has no email address. Could not email this user.")
}
# if $Profile = "NoPay"
}
# foreach u
}
# /ip hotspot user
}
Then you could schedule this script to run every 1day, 1week, 2month, etc…
what should I add to send for the enabled user only? ( I might have some disabled users who has no internet this month or just leave the service but I didn’t delete them)
Yes it does, it accepts any text you want to put in, in raw form. Pictures might have to be encoded with base64 encoding (I haven’t done extensive testing of base64 however).