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/laravelThis also installs supersendtx/supersendtx, the underlying HTTP client.
2. Publish config
php artisan vendor:publish --tag=supersendtx-configAdd to .env:
SUPERSENDTX_API_KEY=stx_your_key_here
# optional override:
# SUPERSENDTX_BASE_URL=https://api.supersendtx.com3. 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/supersendtxSee PHP SDK.
Source
Package source lives in Super-Send/supersendtx-laravel (Packagist requires composer.json at repo root).