Send SMS messages using Clickatell HTTP API.
Requirements ¶
- cURL
- Tested only Yii 1.1.8. May work on older version.
- Caches session data with Yii::app()->cache->set(); so this must be enabled.
Usage ¶
After installation, to send an SMS simply:
Yii::app()->sms->send(array('to'=>'407xxxxxxxx', 'message'=>'Hello world!'));
Installation ¶
- Copy the ClickatellSms folder into protected/extensions/
- Add the following component in your configuration (protected/config/main.php):
'components' => array(
...
'sms' => array(
'class'=>'ext.ClickatellSms.ClickatellSms',
'clickatell_username'=>'your clickatell user',
'clickatell_password'=>'your clickatell password',
'clickatell_apikey'=>'your clickatell api id',
),
...
);
For more options see the README file in the GitHub Repository and PhpDoc.
Resources ¶
- GitHub Repository
- Clickatell API HTTP documentation
Some comments to run this extension
Register clickatell with account Central API (not account communicator)
Enable any cache component, for example:
'cache' => array( 'class' => 'system.caching.CFileCache', ),
Set debug to true and https to false for sms component:
'debug' => true, 'https' => false,
That's all.
like this?
'sms' => array( 'class'=>'ext.ClickatellSms.ClickatellSms', 'clickatell_username'=>'your clickatell user', 'clickatell_password'=>'your clickatell password', 'clickatell_apikey'=>'your clickatell api id', 'cache' => array( 'class' => 'system.caching.CFileCache', ), 'debug' => true, 'https' => false, ),
Re: "like this?"
@Rajith R:
No, the cache component is not part of the sms component. It is a global cache component.
This will do:
'cache' => array( 'class' => 'system.caching.CFileCache', ), 'sms' => array( 'class'=>'ext.ClickatellSms.ClickatellSms', 'clickatell_username'=>'your clickatell user', 'clickatell_password'=>'your clickatell password', 'clickatell_apikey'=>'your clickatell api id', 'debug' => true, 'https' => false, ),
Thanks Vlad V
Thanks Vlad V
how can make a service like Clicktell
hello,
i saw you made an api,
but can you tell me how can i made system like it?
means,
the sms reseller system.
thanks
it's nice..
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.