Search by

sendzovo / sendzovo-php

sendzovo

Official PHP SDK for the Sendzovo transactional email and email verification APIs.

Package info

github.com/nzovopay/sendzovo-php

pkg:composer/sendzovo/sendzovo-php

Statistics

Installs: 8

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-09-14 20:02 UTC

This package is auto-updated.

Last update: 2026-09-14 20:15:33 UTC


README

Official PHP SDK for Sendzovo transactional email and email verification.

Requirements

  • PHP 8.1+
  • cURL extension
  • A Sendzovo sending API key and/or verification API key

Installation

composer require sendzovo/sendzovo-php

Send transactional email

Sending API keys are domain-scoped. The from address must belong to the domain assigned to the key and must satisfy that domain's sender restrictions.

<?php
require 'vendor/autoload.php';

use Sendzovo\Client;

$sendzovo = Client::withSendingKey($_ENV['SENDZOVO_SENDING_API_KEY']);

$result = $sendzovo->messages()->send([
    'from' => 'hello@example.com',
    'from_name' => 'Example App',
    'to' => [
        ['email' => 'customer@example.net', 'name' => 'Customer'],
    ],
    'subject' => 'Welcome',
    'html' => '<h1>Welcome!</h1>',
    'text' => 'Welcome!',
    'tag' => 'welcome',
]);

$messageId = $result['id'];

A send request accepts 1–50 recipients. At least one of html or text is required.

Retrieve a message

$message = $sendzovo->messages()->get($messageId);

Verify an email

Verification API keys are separate from domain-scoped sending keys.

$sendzovo = Client::withVerificationKey($_ENV['SENDZOVO_VERIFICATION_API_KEY']);

$result = $sendzovo->verification()->verify('user@example.com');

Detailed verification

$result = $sendzovo->verification()->verifyDetailed('user@example.com');

Use sending and verification together

$sendzovo = new Client(
    sendingApiKey: $_ENV['SENDZOVO_SENDING_API_KEY'],
    verificationApiKey: $_ENV['SENDZOVO_VERIFICATION_API_KEY'],
);

Error handling

use Sendzovo\Exceptions\SendzovoException;

try {
    $result = $sendzovo->messages()->get('MESSAGE_ID');
} catch (SendzovoException $e) {
    echo $e->getMessage();
    echo $e->statusCode();
    print_r($e->response());
}

API validation, authentication, billing and domain errors are exposed through SendzovoException with the HTTP status and decoded API response when available.

API base URL

The SDK defaults to https://api.sendzovo.com. A custom base URL can be supplied for development/testing.

License

MIT