Package for sending SMS via service gateways

1.0.0 2025-04-18 19:49 UTC

This package is auto-updated.

Last update: 2025-04-18 19:51:05 UTC


README

Base package for sending SMS by HTTP via service gateways.

Gateways

Example

Use GuzzleHttp to send request:

$gateway = new \EnsoStudio\Sms\Gateway\SmscGateway(
    ['apiKey' => '...'],
    new \GuzzleHttp\Client(),
    new \GuzzleHttp\Psr7\HttpFactory()
);
$result = $gateway->sendSms('Test message', [\EnsoStudio\Sms\PhoneUtils::sanitizeNumber('+7 905 710-71-71')]);
if (!$result->isSuccess()) {
    // error handler for $result->getErrors()
}