sendwax/laravel

Send transactional and marketing email through the Sendwax API from Laravel — a drop-in mail transport.

Maintainers

Package info

bitbucket.org/voff-digital/sendwax-laravel

Homepage

pkg:composer/sendwax/laravel

Transparency log

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

v1.0.1 2026-08-25 00:59 UTC

This package is auto-updated.

Last update: 2026-08-25 00:59:28 UTC


README

Send transactional and marketing email through the Sendwax API from any Laravel app. It registers a sendwax mail transport, so your existing Mailables and Notifications keep working — you just point the mailer at Sendwax.

Requirements

  • PHP 8.2+
  • Laravel 10, 11, 12, or 13
  • A Sendwax account with a verified sending domain and an API key (esk_live_…)

Install

composer require sendwax/laravel

The service provider is auto-discovered. Then set two values in your .env:

MAIL_MAILER=sendwax
SENDWAX_KEY=esk_live_your_key_here

That's it. Every Mail::to(...)->send(...) and notification now goes through Sendwax.

Your From address must be on a domain you have added and verified in Sendwax (the same domain, or a subdomain of it). Otherwise the API rejects the send with invalid_from.

Sender name

The From display name is carried through automatically:

Mail::to($user)->send(new OrderShipped($order)); // From: "Acme Store <hello@acme.com>"

Set your default in config/mail.php (from.name / from.address) as usual.

Transactional vs. marketing

Sendwax classifies every message as transactional or marketing. Marketing mail can be blocked by a recipient's marketing opt-out and carries a one-click unsubscribe; transactional mail always sends. The type is chosen like this, in order:

  1. An explicit X-Sendwax-Type header on the message (transactional or marketing).
  2. Otherwise, any message carrying a List-Unsubscribe header is treated as marketing.
  3. Otherwise, the sendwax.default_type config value (default: transactional).

To force a type on a specific message:

use Illuminate\Mail\Mailables\Headers;

public function headers(): Headers
{
    return new Headers(text: ['X-Sendwax-Type' => 'marketing']);
}

Reply-To, HTML, and text

Reply-To, HTML bodies, and plain-text bodies are all forwarded. Cc/Bcc are not supported by the Sendwax API — a message with several To recipients is delivered as one API call per recipient.

Idempotency

Each send includes an idempotency key derived from the message's Message-ID, so a retried delivery (a request timeout, a queued job retry) will not send a duplicate.

Configuration

Publish the config file to change advanced settings:

php artisan vendor:publish --tag=sendwax-config
KeyEnvDefault
sendwax.keySENDWAX_KEY
sendwax.endpointSENDWAX_ENDPOINThttps://sendwax.com
sendwax.default_typeSENDWAX_DEFAULT_TYPEtransactional

License

MIT.