api-php-sdk/examples/send-email.php
2026-11-28 15:28:07 +02:00

19 lines
525 B
PHP

<?php
declare(strict_types=1);
require __DIR__ . '/../autoload.php'; // with Composer: require 'vendor/autoload.php';
use MozOut\Client;
use MozOut\ApiException;
// Key from MOZOUT_API_KEY.
$client = new Client();
// Send one e-mail through the E-mail Center.
$mail = $client->emailCenter->messagesCreate([
'from' => 'Example <notifications@example.com>',
'to' => ['ana@example.org'],
'subject' => 'Your order is ready',
'text' => 'Hello Ana, your order is ready to collect.',
]);
print_r($mail['data']);