SuperSend TX with Laravel

Use the Laravel package for config publishing, a service container binding, and a Facade on top of the PHP SDK.

1. Install the package

composer require supersendtx/laravel

This also installs supersendtx/supersendtx, the underlying HTTP client.

2. Publish config

php artisan vendor:publish --tag=supersendtx-config

Add to .env:

SUPERSENDTX_API_KEY=stx_your_key_here
# optional override:
# SUPERSENDTX_BASE_URL=https://api.supersendtx.com

3. Send an email

use SuperSendTX\Laravel\Facades\SuperSendTX;

$result = SuperSendTX::client()->emails->send([
    'from' => 'ops@yourdomain.com',
    'to' => 'user@example.com',
    'subject' => 'Your receipt',
    'html' => '<p>Thanks for your purchase.</p>',
]);

Or resolve the client from the container:

use SuperSendTX\Client;

public function __construct(private Client $supersendtx)
{
}

$this->supersendtx->emails->send([...]);

Plain PHP without Laravel

If you don't need the service provider or Facade, use the PHP SDK directly:

composer require supersendtx/supersendtx

See PHP SDK.

Source

Package source lives in Super-Send/supersendtx-laravel (Packagist requires composer.json at repo root).