finna/gateway-api

A simple implementation of GatewayAPI. A rock solid SMS API (See https://gatewayapi.com)

Installs: 51

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/finna/gateway-api

v0.0.2 2023-02-28 15:01 UTC

This package is auto-updated.

Last update: 2025-09-19 09:54:56 UTC


README

A simple implementation of GatewayAPI. A rock solid SMS API (See https://gatewayapi.com)

Installation

Use composer to manage your dependencies and download Gateway-API:

composer require finna/gateway-api

Example

use Finna\GatewayApi\GatewayClient;
use Finna\GatewayApi\ParameterException;

$secret = 'your api key here';

try {
    $result = (new GatewayClient($secret))
        ->setSender('My-name') //You can of course set your phone number to allow replies
        ->setRecipients([12345678, 87654321])
        ->setMessage('Test message from GatewayClient')
        ->send();
    error_log(print_r($result, true));
} catch (ParameterException $exception) {
    error_log('Parameter exception: ' . $exception->getMessage());
} catch (Throwable $exception) {
    error_log('Exception: ' . $exception->getMessage());
}