Table of Contents
Set up a SMS gateway and send SMS
In this tutorial today, I will cover how to set up a SMS gateway and send SMS to customers . Well, like for making payment, we need a payment gateway . Similarly, for sending SMS from a website, we need a SMS gateway. You can buy any SMS gateway. Search on google 'SMS gateway provider' . Then open their website and compare each price quote. Just for estimate the idea, they charge around Rs. 1700 for 10000 SMS credits. here You get SMS credits, It means when you send 2 SMS from your website using this SMS gateway then credits balance 10000-2 = 9998 . They also provide their own dashboard where you can also manually send SMS , views sent resorts, manager sender ID and lots of things. Note that sender ID is 6 digit code ex: UNITED , UN1234 . Means it can be alpha-numeric . You have to create from your side in their dashboard and let them to verify it . You should create a sender ID that represents your company brand name because the receiver will see this in their mobile phone when they get the message . To keep SMS gateway setting, let's create SMS Controller1) Create a controller SMSController.php inside app\Http\Controllers
and put below code
Note: on above 'sms_send' function there we have to mention details that you get from your SMS gateway provider , ex: username, password, sender ID,
2) Update function 'payment_status_on_order_place_action' of ShopController.php as shown below
Note that I have mentioned the above SMS sending tutorial from my Laravel ecommerce project.
like I already have Order, OrderItem modal setup.
In your case, you can have some different logic for sending SMS. So, do as per your requirement.