ognjen/laravel-async-mail

Send async mails from Laravel

Installs: 4 320

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/ognjen/laravel-async-mail

v3.0.0 2022-02-10 12:15 UTC

This package is auto-updated.

Last update: 2025-10-10 20:41:50 UTC


README

Sends async mails from Laravel.

As Laravel documentation says:

Since sending email messages can drastically lengthen the response time of your application, many developers choose to queue email messages for background sending. Laravel makes that easy using its built-in unified queue API.

This aproach is different, it leverages "Symfony\Component\Process\Process" class to create separate PHP process and sends an "Illuminate\Mail\Mailable" using artisan command.

Install

Require package with Composer:

composer require ognjen/laravel-async-mail:v3.0.0

Usage example

<?php

namespace App\Observers;

use App\Order;
use App\Mail\OrderCreated;
use Ognjen\Laravel\AsyncMail;

class OrderObserver {
    public function created(Order $order)
    {
        AsyncMail::send(new OrderCreated($order));
    }
}