SMS functionalityfor PHP

v1.0.0 2021-06-23 18:36 UTC

This package is auto-updated.

Last update: 2024-10-24 02:08:06 UTC


README

Build Status Code Coverage Scrutinizer Code Quality
Sms gateway provider service

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