Looking to hire Laravel developers? Try LaraJobs

laravel-async-mail maintained by ognjen

Description
Send async mails from Laravel
Last update
2022/02/10 13:15 (dev-master)
License
Links
Downloads
5 405

Comments
comments powered by Disqus

laravel-async-mail

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));
    }
}