coloursfactory / refreshmailer
FreshMail.pl REST API 实现
dev-master
2017-06-21 09:03 UTC
Requires
- php: >=5.3.0
- ext-curl: *
- ext-json: *
- php-http/client-common: ^1.5
- php-http/client-implementation: ^1.0
- php-http/discovery: ^1.2
- psr/http-message: ^1.0
Requires (Dev)
- guzzlehttp/guzzle: ^6||^5
- guzzlehttp/psr7: ^1.4
- php-http/curl-client: ^1.7
- php-http/guzzle6-adapter: ^1.0
- php-http/message: ^1.5
- php-http/mock-client: ^1.0
- phpunit/phpunit: ^6
Suggests
- guzzlehttp/guzzle: ^6||^5
- guzzlehttp/psr7: ^1.4
- php-http/curl-client: ^1.7
- php-http/mock-client: ^1.0
This package is not auto-updated.
Last update: 2024-09-29 02:49:44 UTC
README
使用此包可以更方便地使用 freshmailer.pl REST API。
它使用适配器来提供正确的 PSR-7 兼容的 HTTP 服务。
实际上实现的适配器有
- cURL
- Guzzle6
欢迎提交新的适配器 :)
请参阅https://freshmail.pl/api_section/jak-zaczac/以获取大量文档。
安装
只需将其添加到您的 composer.json
文件中
{ "require": { "preclowski/refreshmailer": "dev-master" } }
或者,直接使用
composer require preclowski/refreshmailer
用法
use ColoursFactory\ReFreshMailer\FreshMailClient; use ColoursFactory\ReFreshMailer\Http\GuzzleHttpAdapter; use GuzzleHttp\Client; $options = [ 'apiKey' => 'abcdef1234567890', 'apiSecret' => 'abcdef1234567890', ]; $httpAdapter = new GuzzleHttpAdapter(new Client()); // or $httpAdapter = new CurlHttpAdapter(); /** @var HttpAdapterInterface $httpAdapter */ $client = new FreshMailClient($httpAdapter, 'https://api.freshmail.com/rest/', $options); $campaigns = $client->doRequest('/campaigns');
报告问题或功能请求
问题和功能请求在 Github 问题跟踪器中跟踪。