APR
SMS Global Gateway Library for CodeIgniter
Posted by Lee under CodeIgniter Libraries
This is the first of many libraries we will be releasing as open source for the CodeIgniter community. Be certain to keep an eye on this site for future releases and other tips/contributions related to CodeIgniter.
Who is this library ideal for?
Anyone wanting to use the SMS Global (Australia Based) API for sending SMS’s from their application.
How do I use it?
Download this library file and save the as ‘sms_global.php’ in your libraries folder
Loading the Library
First of all you will need to load the library in your controller along with setting your account details from SMS Global and your mobile ‘from’ number (the one that you registered the account with).
$account['user'] = 'username';
$account['pass'] = 'password';
$account['from'] = 'mobile_number';
$this->load->library('Sms_global',$account);
Using the Library
To send an SMS first make sure you have loaded the library as above and then use the below code to send the SMS, please note that I have this as close to conifguration as the standard ‘Email Class’ as possible.
$this->sms_global->to('mobile_number');
$this->sms_global->message('A message goes in here');
$this->sms_global->send();
$id = $this->sms_global->get_sms_id(); // this is the sms id
$this->sms_global->print_debugger(); // only use this to output the message details on screen for debugging
Any suggestions/comments on this library are more then welcome
