1. Go to this page and download the library: Download beziworld/laravel-emaillabs library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
beziworld / laravel-emaillabs example snippets
'mailers' => [
'emaillabs' => [
'transport' => 'emaillabs',
// 'connection' => 'default', // connection from config/emaillabs.php
// 'smtp_account' => '2.yourpanel.smtp', // another SMTP account of the panel
],
],
use Illuminate\Mail\Mailables\Envelope;
public function envelope(): Envelope
{
return new Envelope(
subject: 'Your order has shipped',
tags: ['orders', 'shipping'], // EmailLabs tags (reports, webhooks)
metadata: ['order_id' => $this->order->id], // sent as X-Metadata-order_id
);
}
use Beziworld\EmailLabs\Transport\EmailLabsTransport;
public function headers(): Headers
{
return new Headers(text: [
EmailLabsTransport::HEADER_TEMPLATE => 'welcome-v2',
EmailLabsTransport::HEADER_VARS => json_encode(['name' => $this->user->name]),
'X-TRACKING-OFF' => '1', // disable link tracking for this message
]);
}