Send an SMS when a web page is loaded

So this morning I was working on a php script that would send an SMS to a predefined number upon page load.
The idea being that when an order is placed, rather than checking on the inbox constantly for an order it would be more efficient to receive an SMS when an order is placed.

Now, currently the “problem” of receiving too many messages isnt there right now. This is a high value item and we’d expect three, possibly four orders per day so receiving these notifications as text messages won’t be an issue. It also serves as a prompter for “take action” on the new order.

how did I implement this?
Simple. I used Twilio. Twilio have been around for a number of years and many large corporations use Twilio’s services in their sms and calling applications. So, I figured that integrating Twilio into my client’s payment flow wouldn’t be a cause for concern with reliability.

How to set it up.
Twilio have a great example on their website for this exact process. Here’s the link
You will need an account with Twilio, however you can obtain a free account in order to test and set up your php script. You’ll also receive some credit in your account too, along with a sandbox number to use.

I found the instructions very easy to follow. However, I did have an issue with my Account ID details from Twilio. I Was copying/pasting and for whatever reason it created a space at the start of my Account ID which I didnt realise until about 30 mins in and some googling. So, ensure there are no spaces at the start of your Account ID when you add it to the script!

Ensure you upload all the files to your server and add the sendnotifications.php file to the root or /folder where you have all the twilio files installed.

Works a treat.

Image depicting settings for twilio

Notice the orange arrow. Here you can add any text you like in order to let the viewer know what they need to do next. In this example I’m telling them it’s now ok to go ahead and close down the browser.

Leave a Reply

Your email address will not be published. Required fields are marked *

[stars]
Powered by WordPress All Content Copyright © Marketing Consultant Kevin O'Connor Strategies to Grow Your Business Online
Theme created with SpiderWeb Press™.