nstechns/jazzcms-laravel
最新稳定版本:v1.0.4
Composer 安装命令:
composer require nstechns/jazzcms-laravel
包简介
Laravel Jazz sms api or Campaign Management Solution
README 文档
README
Jazz CMS, Laravel (SMS API)
This package is use for Send SMS, Received SMS, Balance Inquiry, Send SMS Group, send SMS International, Schedule Job using Jazz / Mobilink api.
Installation
You can install the package via Composer:
composer require nstechns/jazzcms-laravel
Now add the service provider in config/app.php file:
'providers' => [ // ... NsTechNs\JazzCMS\JazzCMSServiceProvider::class, ];
You can publish the config-file with:
php artisan vendor:publish --provider="NsTechNs\JazzCMS\JazzCMSServiceProvider" --tag="config"
This is the contents of the published config/jazz-cms.php config file:
return [ /* * In order to integrate the JAZZ - Campaign Management Solution into your site, * you'll need to connect to JAZZ/ Mobilink company to get the credential of SMS API * * Using environment variables is the recommended way of * storing your username, password and mask. Make sure to update * your /.env file with your USERNAME, PASSWORD and From MASK. */ 'base_url' => env('JAZZ_CMS_URL', 'https://connect.jazzcmt.com'), 'username' => env('JAZZ_CMS_USERNAME'), 'password' => env('JAZZ_CMS_PASSWORD'), 'from' => env('JAZZ_CMS_MASK'), 'is_urdu' => env('JAZZ_IS_URDU', false), 'show_status' => env('JAZZ_SHOW_STATUS', true), 'short_code' => env('JAZZ_SHORT_CODE'), ];
You need to set these variables in .env file which you can get from Jazz/ Mobilink:
JAZZ_CMS_USERNAME=030xxxxxxxx JAZZ_CMS_PASSWORD=YourPassword JAZZ_CMS_MASK=MyMask
If you need implement to Received SMS API then you also get JAZZ Short Code:
JAZZ_SHORT_CODE=7005XXX
Usage
Send SMS
you can send sms to local numbers with in country:
use NsTechNs\JazzCMS\JazzCMS; $response = (new JazzCMS)->sendSMS("030xxxxxxxx","message text"); // OR with extra parameters $response = (new JazzCMS)->sendSMS("030xxxxxxxx","message text", "identifier", "unique_id", "product_id", "channel", "transaction_id");
Response:
^ {#173 ▼
+"request": array:7 [▼
"request_size" => 310
"curl_error" => ""
"base_url" => "https://connect.jazzcmt.com"
"content_type" => "text/html; charset=UTF-8"
"redirect_count" => 0
"effective_url" => "https://connect.jazzcmt.com/sendsms_xml.html"
"total_time" => 1.511816
]
+"http_code": 200
+"data": array:7 [▼
"statuscode" => "300"
"statusmessage" => "Message Sent Successfully!"
"messageid" => "31"
"originator" => "MyMask"
"recipient" => "9230xxxxxxxx"
"responsedatetime" => "2021-06-30 17:13:53"
"messagedata" => "testing"
]
+"status": "success"
}
Received SMS
From Date and To Date is Optional: Date Format: 2021-06-30 HH:MM:SS
use NsTechNs\JazzCMS\JazzCMS; $response = (new JazzCMS)->receivingSMS("From Date", "To Date");
Balance Inquiry
Check you current balance of messages.
use NsTechNs\JazzCMS\JazzCMS; $response = (new JazzCMS)->balanceInquiry();
Send SMS Group
You can send sms as group you can create group in Jazz/ Mobilink.
use NsTechNs\JazzCMS\JazzCMS; $response = (new JazzCMS)->sendSMSGroups("Group Name", "Message Text");
send SMS International
You can send sms to international numbers.
use NsTechNs\JazzCMS\JazzCMS; $response = (new JazzCMS)->sendSMSInternational("030xxxxxxxx", "Message Text");
Schedule Job
You can set Schedule Job as list of file contacts. Schedule Date Time Format: 2021-06-30 HH:MM:SS The Schedule Date Time is optional you can send sms immediately
use NsTechNs\JazzCMS\JazzCMS; $response = (new JazzCMS)->scheduleJob("file_with_path", "Message Text", "Schedule Date Time");
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
composer test
Security
If you discover any security related issues, please email nstech42@gmail.com instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 637
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-06-29
