All Projects → taiwan-sms → twsms

taiwan-sms / twsms

Licence: MIT license
台灣簡訊 twsms api client

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to twsms

amaran-laravel
AmaranJS stylish notification for your laravel application.
Stars: ✭ 24 (+50%)
Mutual labels:  notification
notice.js
💯 Javascript notification library
Stars: ✭ 25 (+56.25%)
Mutual labels:  notification
denbun
Adjust showing frequency of Android app messages, and to be more user friendly 🐦
Stars: ✭ 17 (+6.25%)
Mutual labels:  notification
SwiftUI-DesignCode
 SwiftUI-DesignCode is some examples in the process of learning swiftUI 2.0
Stars: ✭ 185 (+1056.25%)
Mutual labels:  notification
discord-notifier
Provides Discord integration for Symfony Notifier
Stars: ✭ 24 (+50%)
Mutual labels:  notification
stackdriver-to-discord
[Unmaintained] ⚙️ A simple Google Cloud Function in Go to transform / proxy Stackdriver Static Webhook notifications to Discord.
Stars: ✭ 18 (+12.5%)
Mutual labels:  notification
snmp notifier
A webhook to relay Prometheus alerts as SNMP traps, because sometimes, you have to deal with legacy
Stars: ✭ 33 (+106.25%)
Mutual labels:  notification
flutter-push-notification-without-firebase
Flutter push notification without firebase with background services feature
Stars: ✭ 42 (+162.5%)
Mutual labels:  notification
MaterialToast
A fully and highly customizable material designed Toast for Android.
Stars: ✭ 31 (+93.75%)
Mutual labels:  notification
flasher
A powerful and flexible flash notifications system for PHP
Stars: ✭ 46 (+187.5%)
Mutual labels:  notification
crypto-watchdog
Crypto Watchdog is an open-source developer friendly project, periodically queries crypto market and notifies potential pumps & recently added tokens/coins via web-hooks.
Stars: ✭ 22 (+37.5%)
Mutual labels:  notification
Whizzz-The-ChatApp
Whizzz is a real-time, one-to-one Android chat application made using Firebase, a beautiful user interface, and a push-notification feature.
Stars: ✭ 66 (+312.5%)
Mutual labels:  notification
binance-spot-order-notification-heoku
[binance order trade fill notification] Telegram Notification when Binance order created, cancelled or filled. Ready to Deploy on Heroku
Stars: ✭ 30 (+87.5%)
Mutual labels:  notification
gotify-push
Chrome Extension for Send Push Notification 🔔 to gotify/server ☁
Stars: ✭ 32 (+100%)
Mutual labels:  notification
purppura
A server for receiving and processing alerts & events.
Stars: ✭ 18 (+12.5%)
Mutual labels:  notification
jetson-monitor
🚨 Jetson is an HTTP monitoring service used to notify by various messaging platforms such as Slack and Telegram
Stars: ✭ 45 (+181.25%)
Mutual labels:  notification
SimpleToast
SimpleToast is a simple, lightweight, flexible and easy to use library to show toasts / popup notifications inside iOS or MacOS applications in SwiftUI. Because of the flexibility to show any content it is also possible to use the library for showing simple modals.
Stars: ✭ 131 (+718.75%)
Mutual labels:  notification
janitor
Availability monitoring and alerting for IOT devices
Stars: ✭ 55 (+243.75%)
Mutual labels:  notification
Taskly
Flutter app to manage tasks.
Stars: ✭ 126 (+687.5%)
Mutual labels:  notification
MusicPlayer
Android music player example.
Stars: ✭ 20 (+25%)
Mutual labels:  notification

TwSMS notifications channel for Laravel 5.3+

StyleCI Build Status Total Downloads Latest Stable Version Latest Unstable Version License Monthly Downloads Daily Downloads Scrutinizer Code Quality Code Coverage

This package makes it easy to send notifications using [twsms] with Laravel 5.3+.

Contents

Installation

You can install the package via composer:

composer require taiwan-sms/twsms illuminate/notifications php-http/guzzle6-adapter

Then you must install the service provider:

// config/app.php
'providers' => [
    ...
    TaiwanSms\TwSMS\TwSMSServiceProvider::class,
],

Setting up the TwSMS service

Add your TwSMS login, secret key (hashed password) and default sender name (or phone number) to your config/services.php:

// config/services.php
...
'twsms' => [
    'username' => env('SERVICES_TWSMS_USERNAME'),
    'password' => env('SERVICES_TWSMS_PASSWORD'),
],
...

Usage

You can use the channel in your via() method inside the notification:

use TaiwanSms\TwSMS\TwSMSMessage;
use TaiwanSms\TwSMS\TwSMSChannel;
use Illuminate\Notifications\Notification;

class AccountApproved extends Notification
{
    public function via($notifiable)
    {
        return [TwSMSChannel::class];
    }

    public function toTwSMS($notifiable)
    {
        return TwSMSMessage::create("Task #{$notifiable->id} is complete!");
    }
}

In your notifiable model, make sure to include a routeNotificationForTwSMS() method, which return the phone number.

public function routeNotificationForTwSMS()
{
    return $this->phone;
}

Available methods

content(): Sets a content of the notification message.

sendTime(): Set send time of the notification message.

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

API Only

composer require taiwan-sms/twsms php-http/guzzle6-adapter

How to use

require __DIR__.'/vendor/autoload.php';

use TaiwanSms\TwSMS\Client;

$userId = 'xxx';
$password = 'xxx';

$client = new Client($userId, $password);

var_dump($client->credit()); // 取得額度
var_dump($client->send([
    'to' => '09xxxxxxxx',
    'text' => 'test message',
]));
/*
return [
    'code' => '00000',
    'text' => 'Success',
    'msgid' => '265078525',
];
*/
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].