skrybe / sdk-php
PHP SDK for Skrybe Email Newsletter Service
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/skrybe/sdk-php
Requires
- php: >=7.4
- guzzlehttp/guzzle: ^7.0
- psr/log: ^3.0
Requires (Dev)
- phpunit/phpunit: ^9.0
README
A PHP SDK for interacting with the Skrybe Email Newsletter Service. This SDK provides a simple and elegant way to integrate email newsletter functionality into your PHP applications.
Requirements
- PHP 7.4 or higher
- Composer
- GuzzleHttp 7.0 or higher
- PSR-3 compatible logger (optional)
Installation
- Install via Composer:
composer require skrybe/sdk-php
- (Optional) Install Monolog for logging:
composer require monolog/monolog
Usage
use Skrybe\SkrybeSDK; $sdk = new SkrybeSDK('your-api-key'); // Send an email $response = $sdk->sendEmail([ 'fromName' => 'John Doe', 'fromEmail' => 'john@example.com', 'replyTo' => 'reply@example.com', 'subject' => 'Hello World', 'htmlText' => '<h1>Hello World</h1>', 'to' => ['user@example.com'] ]); // Get lists $lists = $sdk->getLists(); // Create a campaign $campaign = $sdk->createCampaign([ 'fromName' => 'John Doe', 'fromEmail' => 'john@example.com', 'replyTo' => 'reply@example.com', 'title' => 'My Campaign', 'subject' => 'Hello World', 'htmlText' => '<h1>Hello World</h1>', 'listIds' => ['list-id-1', 'list-id-2'] ]);
Available Methods
Email Operations
sendEmail(array $options)- Send an email to recipientscreateCampaign(array $options)- Create an email campaigngetLists(bool $includeHidden = false)- Get all mailing lists
Documentation
For detailed documentation, please see the docs directory.