Sending transactional email from Laravel with a real API, not SMTP
Laravel's Mail facade defaults to SMTP, configured through a mail driver in config/mail.php. Switching a transactional send to Envello's HTTP API means either writing a custom Mail transport or, more simply for a focused set of transactional emails, calling the API directly and keeping Laravel's Blade views for rendering.
The direct approach
Render your Blade view to a string, then POST it to Envello's API with Laravel's built-in Http facade, no extra package required:
- $html = view('emails.welcome', ['name' => $user->name])->render();
- Http::withToken(config('services.envello.key'))->post('https://api.envello.dev/emails', ['from' => 'Acme <[email protected]>', 'to' => $user->email, 'subject' => 'Welcome!', 'html' => $html]);
- Check ->successful() on the response and handle a failed send explicitly rather than assuming it worked
Keeping this out of the request cycle
For anything triggered by a web request, wrap the send in a queued job (Laravel's built-in queue system) rather than calling the API synchronously inside a controller. That keeps a slow or failed API call from holding up the response to your user, and gives you Laravel's existing job-retry mechanism for free if the send fails transiently.
If you want an SDK instead
A PHP SDK exists (packages/sdk-php in Envello's repo, composer require envello/envello-php), but it's honest to say it isn't published on Packagist yet, you'd need to require it as a local path repository for now. For most Laravel apps, Http::withToken(...)->post(...) is few enough lines that waiting on a published package isn't a real blocker.