PHP Script Text Sending Query


Broadly speaking, I need to send a text message (alert) when a water tank level reaches a certain point. I have successfully done this using a PHP script embedded in html.

The problem I have discovered is that these texts are received in an untimely manner. For instance, some are received within 20 seconds and others withing minutes, hours and probably not at all in some cases. I have added a time stamp to this script so I know when they were triggered and how long it took for each text to be received.

That said, because a falling water tank level must be attended to ASAP, using my method to send text messages (alerts!) does not seem like the best way to send these text alerts. In addition, I think the loading of webpages which contain these PHP scripts has slow down considerably.

I have looked into using an SMS service, but each of these (from what I have read) requires the user to manually enter data and send the text. This will not work for me because I want the text to be sent automatically.

If anyone has a better idea on how to accomplish this - or improve my method - I would dearly like to hear it.

Thank you!

That is simply incorrect.

AWS offers simple notification service (AWS SNS) that can be used to publish messages across many different types of channels.

AWS SDK v3 provides an api for adding messages to the queue programmatically.

Docs related to sending SMS messages using this service.

For the task of monitoring water levels and sending notifications I would probably also recommend using AWS to build a complete cloud solution. Seems like a fairly straight forward requirement that cloud technologies would handle well. You might even be able to do it by wiring up varous services with very little to no code. Probably would depend on where you are getting the data from and how to stream that data into AWS reliably.

Thank you so much for that info. I will look into that.