pingram / php
Official PHP SDK for Pingram - Send notifications via Email, SMS, Push, In-App, and more
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
pkg:composer/pingram/php
Requires
- php: ^8.1
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3
- guzzlehttp/psr7: ^1.7 || ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- phpunit/phpunit: ^8.0 || ^9.0
README
Official PHP SDK for Pingram. Send notifications via Email, SMS, Push, In-App, and more from your PHP application.
Requirements
- PHP 8.1+
- Composer
- guzzlehttp/guzzle (installed via Composer)
Installation
composer require pingram/php
Or add to your composer.json:
{
"require": {
"pingram/php": "^0.1"
}
}
Then run composer install.
Quick start
Use the Pingram\Client with your API key, then call send() or the namespaced APIs (getDomains(), getSender(), etc.).
<?php require_once __DIR__ . '/vendor/autoload.php'; use Pingram\Client; use Pingram\Model\SenderPostBody; $client = new Client('pingram_sk_...'); // Send a notification (delegates to the default/sender API) $body = new SenderPostBody([ 'notification_id' => 'your_notification_id', 'to' => ['id' => 'user_123'], ]); $response = $client->send($body); // Or use namespaced APIs: $client->getDomains(), $client->getSender(), etc. // $senders = $client->getDomains()->domainsListDomains();
You can override the base URL by passing a second argument: new Client('pingram_sk_...', 'https://api.example.com').
What can I call?
$client->send($body)– send a notification (high-level).$client->getDomains(),$client->getSender(),$client->getAccount(), etc. – low-level API objects. Each has methods matching the API (e.g.domainsListDomains,senderTestEmail).
For the full list of methods on each API, see the package's API_REFERENCE.md or the documentation.