Creating a Laravel Unsend Transport
mattstein.com·17w
Preview
Report Post

How to send Laravel email using Unsend.

I’ve been using Unsend all over the place now that I’m self-hosting it.

In my Laravel apps I’d started out using a generic SMTP connection before realizing a simple custom transport could connect with the Unsend API directly.

The documentation was straightforward, and the bulk of the effort was mapping Laravel’s message details to a suitable API payload and testing it.

I started by creating app/Mail/Transports/UnsendTransport.php:

<?php

namespace App\Mail\Transports;

use Illuminate\Support\Facades\Http;
use Illuminate\Support\Uri;
use Symfony\Component\Mailer\SentMessage;
use Symfony\Component\Mailer\Tran...

Similar Posts

Loading similar posts...