1. Open an account with Twilio
Note that Twilio is not free. Their rates depend on number of messages you going to send and many other things.
2. Download Twilio PHP client code and unzip Services folder to your output directory.
This will create Services folder with one file (Twilio.php) and one folder (Twilio) in there.
3. Store logged user cell phone in session variable
Assuming that cell_phone is a field in the login table we can use AfterSuccessfulLogin event. That's the phone number where we will be sending SMSs.
4. Add button to the List page grid.
Proceed to Twilio control panel and note your phone number, Account SID and Auth Token. You are going to need them soon.
Button Server event code
require "Services/Twilio.php"; $AccountSid = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; $AuthToken = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; $TwilioNumber="xxx-xxx-xxxx"; $http = new Services_Twilio_TinyHttp('https://api.twilio.com', array('curlopts' => array( CURLOPT_SSL_VERIFYPEER => false ))); $client = new Services_Twilio($AccountSid, $AuthToken, null, $http); $record = $button->getCurrentRecord(); $sms = $client->account->messages->sendMessage( $TwilioNumber, $_SESSION["cell_phone"], "Make: ".$record["Make"]."\n". "Model: ".$record["Model"]."\n". "YearOfMake: ".$record["YearOfMake"]."\n". "Price: ".$record["Price"] );