PHP code example of bjthecod3r / laravel-zeptomail
1. Go to this page and download the library: Download bjthecod3r/laravel-zeptomail 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/ */
use BjTheCod3r\ZeptoMail\ZeptoMail;
use Illuminate\Mail\Mailables\Envelope;
use Symfony\Component\Mime\Email;
public function envelope(): Envelope
{
return new Envelope(
subject: 'Your order has shipped',
using: [
fn (Email $message) => ZeptoMail::message($message)
->clientReference("order-{$this->order->id}")
->trackOpens()
->trackClicks(false),
],
);
}
public function envelope(): Envelope
{
return new Envelope(
using: [
fn (Email $message) => ZeptoMail::message($message)
->template('2d6f.34a5b1c7d8e9f0a1.k1.abc...')
->mergeInfo([
'name' => $this->user->name,
'order_id' => $this->order->id,
]),
],
);
}