traccar / traccar

Traccar GPS Tracking System
https://www.traccar.org
Apache License 2.0
5.13k stars 2.56k forks source link

SMS notifications, Per User Limit setting solution #5367

Open byhturk opened 1 month ago

byhturk commented 1 month ago

Is your feature request related to a problem? Please describe. I am willing to develop this feature if there is community demand.

This feature might be interesting. It may be important in reducing administrative costs. it can also block abuse or malfunctioning device notifications.

Describe the solution you'd like This feature prevents misuse of SMS notifications. It can reduce the manager's costs. SMS notification limit can be set on a user-based annual basis.

Describe alternatives you've considered 1- An entry such as "smsNotificationLimit:123" can be created in the user properties from the web interface. 2- The prerequisite can be processed into the NotificatorSms.java code in the Traccar Server code. If smsNotificationLimit > 0 in the user property, the SMS sending function is run. 3-After the SMS is sent, the value read from the user attributes is reduced by -1 and recorded again. Finally, the remaining SMS limit for the user can be displayed in a convenient place on the notifications page on Traccar Web.

Additional context To ensure that this feature does not block SMS notifications by default, a key with a bolan value is added to the server attributes to enable the SMS limit on a user-based basis on the server. Thus, those who do not want to use SMS limits will not be affected by the update.

tananaev commented 1 month ago

It would be good to have a generic solution that will apply to all notifications.

What about device SMS?

byhturk commented 1 month ago

It would be good to have a generic solution that will apply to all notifications.

What about device SMS?

You are right, we need to add the SMS sent to the device to this work.

It seemed like the limit feature might be good for SMS notifications, which are relatively costly. There's no Firebase cost, why would there be a need for a global limitation? Am I missing something sir?

tananaev commented 1 month ago

Email is generally not free and prone to abuse, so it would be good to have email limits as well.