delboy1978uk / sms
SMS functionalityfor PHP
v1.0.0
2021-06-23 18:36 UTC
Requires (Dev)
This package is auto-updated.
Last update: 2024-11-24 02:23:28 UTC
README
installation
Install via composer
composer require delboy1978uk/sms
usage
Create a provider, passing in the necessary config, and create the service, passing in the provider adapter:
<?php use SomeProvider; use SmsService; $config = [ 'client_id' => 'whatever', 'client_secret' => 'whatever', 'api_url' => 'https://whatever', 'authentication_url' => '/authorize', 'tokenurlurl' => '/token', ]; $adapter = new SomeProvider($config); $smsService = new SmsService($adapter);
sending a text
$number = '00447123456789'; $message = 'Your delivery is about to arrive!'; $smsService->sendSms($number, $message);
sending to a group of people
$numbers = ['00447123456789', '0032123123456']; $message = 'The latest and greatest version of X is out now!!'; $smsService->sendGroupSms($numbers, $message);