MAILMANAGED / DEVELOPERS

Laravel quickstart

Route administrative notifications from your Laravel application to the recipients you configure in MailManaged.

1. Connect your website

Create an account, add your website, and verify ownership using the TXT record shown in your dashboard. Add your administrator recipients and have them confirm their email addresses. Activate a subscription and create a site token.

2. Install the connector

composer require inspectornetwork/mailmanaged

The connector registers a mailmanaged mailer automatically. Add the website’s token to your environment:

MAILMANAGED_TOKEN=your-site-token
The connector source is included in the platform repository. The public Composer installation command becomes available after the package is published to Packagist.

3. Send an administrative message

use Illuminate\Support\Facades\Mail;

Mail::mailer('mailmanaged')->raw(
    'A new contact enquiry arrived from your website.',
    fn ($message) => $message
        ->subject('New contact enquiry')
        ->replyTo('visitor@example.com')
);

Your configured recipients are selected by MailManaged. No to() call is required. Any supplied To, Cc, or Bcc addresses are discarded. The same mailer works with Laravel Mailables.

Default mailer

For a website whose entire mail output is administrative, you may also set MAIL_MAILER=mailmanaged. Applications that send customer email should explicitly select this mailer only for administrative messages.

Send to a group

Set MAILMANAGED_GROUP=contact for a default connector group, or set X-MailManaged-Group on an individual message’s Symfony headers. Group slugs come from your dashboard.

Queued mail and retries

For a queued Mailable, set a stable X-MailManaged-Idempotency-Key header derived from the submission ID. Reuse it when retrying that submission. The API deduplicates identical requests for 24 hours; a new key creates a new message.

use Illuminate\Mail\Mailables\Headers;

public function headers(): Headers
{
    return new Headers(text: [
        'X-MailManaged-Group' => 'contact',
        'X-MailManaged-Idempotency-Key' => 'contact-'.$this->submissionId,
    ]);
}

Attachments are rejected. HTML and plain text bodies are supported. Keep API tokens on the server; never put them in browser JavaScript.