Search by

sendmux / sending

roshanjonah

This package is abandoned and no longer maintained. The author suggests using the qubrics/sending package instead.

Qubrics Sending API client for PHP.

v3.0.0 2026-11-06 00:41 UTC

README

Packagist version PHP version License

Qubrics Sending API client for PHP.

Read the PHP SDK guide at qubrics.com/docs/sdks/php.

Requirements

  • PHP 8.2 or newer.
  • Composer.
  • A send-capable smx_mbx_ key or owner-approved Sending-resource smx_agent_ token. Alternatively, use a REST OAuth access token with the required scopes.

Installation

Run this command only after Packagist lists qubrics/sending version 3.0.0. Until then, retain your existing Composer constraint.

composer require qubrics/sending:^3.0

Before upgrading from 2.x, read the PHP 3.0 migration guide for Composer package and PHP namespace changes. If you use 1.x, apply the PHP 2.0 migration guide first.

If your custom Guzzle client uses FileCookieJar or SessionCookieJar, back up its state and re-authenticate into a fresh jar when upgrading. Guzzle rejects old records without a boolean HostOnly; do not guess that value. Default Qubrics API clients do not enable cookies. See the upstream migration warning.

Usage

Create the API group client with a send-capable key.

<?php

require __DIR__ . '/vendor/autoload.php';

use Qubrics\Sending\ClientFactory;

$emails = ClientFactory::createEmailsApi(
    getenv('QUBRICS_MAILBOX_API_KEY') ?: getenv('SENDMUX_MAILBOX_API_KEY') ?: null
);

$meta = ClientFactory::createMetaApi(
    getenv('QUBRICS_MAILBOX_API_KEY') ?: getenv('SENDMUX_MAILBOX_API_KEY') ?: null
);

The generated EmailsApi exposes sendingSendEmail() and sendingSendEmailBatch(). The generated MetaApi exposes sendingGetConnection() to test credentials without sending email, and sendingGetOpenApiSpec().

OAuth access tokens

ClientFactory::createMetaApiWithAccessToken($accessToken) accepts a bare token or a callable returning one. Every API group factory has the same WithAccessToken variant. Providers run on each request and retry; your application owns token storage and refresh coordination. OAuth clients do not follow redirects.

$client = ClientFactory::createMetaApiWithAccessToken(
    static fn (): string => getenv('QUBRICS_ACCESS_TOKEN') ?: getenv('SENDMUX_ACCESS_TOKEN') ?: ''
);

See OAuth setup and lifecycle.

For API-key authentication, omit apiKey to read QUBRICS_API_KEY. Omit baseUrl to read QUBRICS_BASE_URL. Nonempty Qubrics values take precedence over SENDMUX_API_KEY and SENDMUX_BASE_URL. Explicit arguments take precedence over environment values.

Features

  • Validates smx_mbx_ keys or owner-approved Sending-resource smx_agent_ tokens before configuring the client.
  • Uses https://smtp.qubrics.com/api/v1 by default.
  • Adds retry and rate-limit backoff behaviour through qubrics/core.
  • Maps generated API responses into the shared Qubrics envelope and error model.
  • Includes generated models for single-send and batch-send requests and responses.

Related packages

Package Use it for
qubrics/core Shared helpers for auth, headers, retries, pagination, and errors.
qubrics/mailbox Mailbox API client.
qubrics/management Management API client.
qubrics/sdk Umbrella package that installs all PHP SDK surfaces.

Support

For help, include the package name, version, API surface, and sanitised request details. Do not include API keys, tokens, passwords, webhook secrets, customer data, or private account details.

License

MIT. See LICENSE.