mailvoidr/laravel

Official Laravel SDK for the Mailvoidr transactional email API

Maintainers

Package info

github.com/mailvoidr/laravel

pkg:composer/mailvoidr/laravel

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.4 2026-06-29 15:30 UTC

This package is auto-updated.

Last update: 2026-06-29 15:32:28 UTC


README

Official Laravel client for the Mailvoidr transactional email API.

Use this when SMTP port 587 is unavailable — the HTTP API delivers the same way.

Install

composer require mailvoidr/laravel

Configure

Only your API key is required. Base URL, default sender (hello@mailvoidr.com), and timeout are built in.

MAIL_MAILER=mailvoidr
MAILVOIDR_API_KEY=mvdr_live_your_key_here

Add a mailer in config/mail.php:

'mailvoidr' => [
    'transport' => 'mailvoidr',
],

That's it — Mail::, Mailables, and Notifications all route through Mailvoidr.

Laravel Mail (recommended)

use Illuminate\Support\Facades\Mail;
use App\Mail\WelcomeMail;

Mail::to('riya@example.com')->send(new WelcomeMail());
// Notification
$user->notify(new OrderShipped($order));

Default sender is hello@mailvoidr.com. Override per mailable:

return $this->from('hello@mail.yourdomain.com', 'Acme')
    ->subject('Welcome')
    ->view('emails.welcome');

Direct API client

use Mailvoidr\Laravel\Facades\Mailvoidr;

$response = Mailvoidr::send([
    'to' => ['riya@example.com'],
    'subject' => 'Welcome to Acme',
    'html' => '<h1>Hey Riya</h1>',
]);

$send = Mailvoidr::getSend($response->id);

Inject the client:

use Mailvoidr\Laravel\Client\MailvoidrClient;

public function __construct(private MailvoidrClient $mailvoidr) {}

Errors

MailvoidrException is thrown on 402 (plan limit), 403 (live sending off), 422 (validation), and other non-success responses. The mail transport wraps these as TransportException.