Skip to content

mbdwey/smsgo-for-laravel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Smsgo library for Laravel

Send SMS using Smsgo API

Requirements

  • Smsgo account & payment for API use
  • Laravel 1.5.x
  • cURL

Installation

  • 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

Usage

$sms = Smsgo::make()
        ->from('1004')
        ->to('010-1234-5677')
        ->message('Hello world')
        ->send();

if ($sms->ok())
{
    // message sent successfully
}
else
{
    var_dump($sms->results);
}

Using template

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();

Bug report / Feedback

About

Smsgo library for Laravel PHP Framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published