smartsender / smartsender-php
PHP client for SmartSender API v3
0.9.4
2019-05-15 12:10 UTC
Requires
- php: >=7.1
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- ext-openssl: *
Requires (Dev)
- phpunit/phpunit: ^7
Suggests
- guzzlehttp/guzzle: For using a power of Guzzle (>=6.0)
This package is auto-updated.
Last update: 2024-08-18 04:05:52 UTC
README
Installation
composer require smartsender/smartsender-php
or add to your composer.json file next row and then execute "composer install" command
"require": { ... "smartsender/smartsender-php": ">=0.9.4", ... }
SmartSender API version 3
The SmartSender API can be found here.
Getting Started
$accessToken = new \SmartSender\V3\Auth\AccessToken('putYourAccessTokenHere'); $adapter = new \SmartSender\V3\Adapter\CurlAdapter($accessToken); $mailer = new \SmartSender\V3\Client\Mailer($adapter); try { // Almost all declared methods can throw an Exception, so you can catch it $email = new \SmartSender\V3\Email\Email(); // Set parameters of Email // ... $email = $mailer->sendEmail($email); echo $email->getId(); } catch(\SmartSender\V3\Exceptions\SmartSenderException $e) { echo $e->getMessage(); }
SDK Documentation
If you don't want to deal with objects and all you need is arrays of parameters, you can use adapter's request() method in conjunction with SmartSender API documentation Example you can find here
Note that this repository is currently under development, additional classes and endpoints being actively added.