๐Ÿ”’ Closed Payment Reminder Mikrotik RouterOS

Status
Not open for further replies.
To set up a payment reminder for a Mikrotik RouterOS hotspot, you can use the following steps:

1. Create a hotspot user profile that includes a session-timeout value. This will be the period of time for which the user is allowed access to the hotspot after making a payment.

2. Configure the hotspot server to use the aforementioned user profile.

3. Use the Mikrotik RouterOS scheduler to regularly check the user accounts and send out payment reminders. To do this, create a script that sends out an email or SMS reminder to the user when their account is about to expire.

4. Schedule the script to run at regular intervals, for instance, every day, to ensure timely reminders are sent to the users.

Here's an example script that sends out an email reminder to users whose accounts are about to expire:

Code:
# Define variables
:local emailBody ""
:local emailSubject "Payment Reminder - Mikrotik Hotspot"

# Loop through all active hotspot users
:foreach i in=[/ip hotspot active find where server=hotspot1] do={
  # Check if user's session-timeout is less than 2 hours
  :if ([:len [/ip hotspot active get $i session-time-left]] > 0 &&
      [/ip hotspot active get $i session-time-left] < 2h ) do={
      
    # Get user's email address
    :local emailAddress [/ip hotspot user get [/ip hotspot active get $i user] email]
    
    # Construct email body
    :set emailBody "Dear hotspot user, your account is about to expire in " . 
                    [/ip hotspot active get $i session-time-left] ". Please make sure to recharge your account to continue using the hotspot service."
    
    # Send out email reminder
    /tool e-mail send to=$emailAddress subject=$emailSubject body=$emailBody   
  }
}

Note that you'd need to fill in the necessary details, such as the email subject, hotspot server name, and so on.
 
To set up a payment reminder for a Mikrotik RouterOS hotspot, you can use the following steps:

1. Create a hotspot user profile that includes a session-timeout value. This will be the period of time for which the user is allowed access to the hotspot after making a payment.

2. Configure the hotspot server to use the aforementioned user profile.

3. Use the Mikrotik RouterOS scheduler to regularly check the user accounts and send out payment reminders. To do this, create a script that sends out an email or SMS reminder to the user when their account is about to expire.

4. Schedule the script to run at regular intervals, for instance, every day, to ensure timely reminders are sent to the users.

Here's an example script that sends out an email reminder to users whose accounts are about to expire:

Code:
# Define variables
:local emailBody ""
:local emailSubject "Payment Reminder - Mikrotik Hotspot"

# Loop through all active hotspot users
:foreach i in=[/ip hotspot active find where server=hotspot1] do={
  # Check if user's session-timeout is less than 2 hours
  :if ([:len [/ip hotspot active get $i session-time-left]] > 0 &&
      [/ip hotspot active get $i session-time-left] < 2h ) do={
    
    # Get user's email address
    :local emailAddress [/ip hotspot user get [/ip hotspot active get $i user] email]
  
    # Construct email body
    :set emailBody "Dear hotspot user, your account is about to expire in " .
                    [/ip hotspot active get $i session-time-left] ". Please make sure to recharge your account to continue using the hotspot service."
  
    # Send out email reminder
    /tool e-mail send to=$emailAddress subject=$emailSubject body=$emailBody 
  }
}

Note that you'd need to fill in the necessary details, such as the email subject, hotspot server name, and so on.
Set up payment reminder using webproxy and allow specific website to bypass walled garden in mikrotik hotspot routeros without using email
 
Status
Not open for further replies.

About this Thread

  • 3
    Replies
  • 2K
    Views
  • 2
    Participants
Last reply from:
dev-ace

Online now

Members online
628
Guests online
653
Total visitors
1,281

Forum statistics

Threads
2,276,935
Posts
28,973,174
Members
1,230,625
Latest member
heyuhe
Back
Top