Search by

noburi / send-php

jiordiviera

PHP client for the Noburi Send transactional email API.

v0.2.0 2026-11-18 16:06 UTC

This package is auto-updated.

Last update: 2026-11-18 16:56:52 UTC


README

PHP client for the Noburi Send transactional email API.

Using Laravel? Install noburi/send-laravel instead: it brings this client, a mail transport and webhook events.

Install

composer require noburi/send-php

Requires PHP 8.2 or later.

Send an email

$noburi = Noburi\Send\NoburiSend::client('ps_live_xxxxxxxxx');

$email = $noburi->emails->send([
    'from' => 'Acme <hello@acme.com>',
    'to' => ['jane@example.com'],
    'subject' => 'Your login code',
    'html' => '<p>Your code is <strong>123456</strong></p>',
], ['idempotency_key' => 'otp-42']);

echo $email['id']; // em_...

Every part of the API is a property, or a method of the same name:

Service Calls
emails send, batch, get, list, update, reschedule, cancel
domains create, list, get, update, verify, remove
webhooks create, list, get, update, rotateSecret, test, remove
templates create, list, get, update, remove, publish, render, versions

Answers are the API's JSON, decoded into arrays.

Errors

An API error throws a subclass of Noburi\Send\Exception\ApiException, with the fields of the error object:

use Noburi\Send\Exception\ValidationException;

try {
    $noburi->emails->send([...]);
} catch (ValidationException $e) {
    $e->errorCode; // domain_not_verified
    $e->param;     // from
    $e->docUrl;    // link to the error's documentation
}

AuthenticationException, PermissionException, NotFoundException, ValidationException, InsufficientCreditsException, IdempotencyException and RateLimitException (with retryAfter) follow the error's type. A network failure throws ApiConnectionException.

Webhooks

use Noburi\Send\Webhook;

$event = Webhook::constructEvent(
    file_get_contents('php://input'),
    $_SERVER['HTTP_X_PULSESEND_SIGNATURE'] ?? null,
    'your_webhook_secret',
);

It throws SignatureVerificationException when the signature is missing, wrong or older than five minutes.

Options

Noburi\Send\NoburiSend::client('ps_live_...', [
    'base_url' => 'https://send.noburi.space',
    'timeout' => 30,
]);

License

MIT

Moving from pulsesend/pulsesend-php

Same code, new name: composer remove pulsesend/pulsesend-php && composer require noburi/send-php, then replace PulseSend\ with Noburi\Send\ in your imports and PulseSend::client(...) with NoburiSend::client(...). The API and your keys do not change.