codexsoft / unisender-one-api-php-client
Unisender One API PHP 客户端 (https://www.unisender.com/en/features/unione/ )
v1.0.0
2020-03-27 19:26 UTC
Requires
- php: ^7.4
- ext-json: *
- guzzlehttp/guzzle: ^6.5
This package is auto-updated.
Last update: 2024-09-28 05:10:58 UTC
README
#Unisender One API PHP 客户端
安装
composer require codexsoft/unisender-one-api-php-client
用法
require_once __DIR__.'/vendor/autoload.php'; $client = new \CodexSoft\UnisenderOneApiSdk\Client('YOUR_USERNAME', '<YOUR_API_KEY>'); $balance = $client->getBalance(); $client->sendEmail([ 'body' => [ 'html' => '<h1>Hello world</h1>', 'plaintext' => 'Hello world', ], 'subject' => 'Example subject', 'from_email' => 'noreply@example.com', 'from_name' => 'John Doe', 'reply_to' => 'reply@example.com', 'track_links' => 1, 'track_read' => 1, 'headers' => [ 'X-ReplyTo' => 'reply@example.com', ], 'recipients' => [ [ 'email' => 'jane@example.com', 'substitutions' => [], 'metadata' => [], ] ], 'metadata' => [], 'attachments' => [], 'inline_attachments' => [], 'options' => [], ]);