Send SMS using Smsgo API
- Smsgo account & payment for API use
- Laravel 1.5.x
- cURL
- clone this repo or copy all directories&files to your application directory
- Register to Smsgo and get API key
- Edit smsgo.php in your config diretory
$sms = Smsgo::make()
->from('1004')
->to('010-1234-5677')
->message('Hello world')
->send();
if ($sms->ok())
{
// message sent successfully
}
else
{
var_dump($sms->results);
}
Define your template in smsgo.php in your config directory.
'templates' => array(
'my_template' => array(
'title' => 'My template',
'body' => 'Hi, I am {MYNAME}!'
)
),
Any keyword wrapped in { and } will be replaced with array passed in template()
$sms = Smsgo::make()
->from('1004')
->to('010-1234-5677')
->template('my_template', array(
'MYNAME' => 'Yunseok Kim'
))
->send();