Email digital receipts, add promo settings, and apply tips at charge.
Deploy Ladill POS / deploy (push) Successful in 31s

Send real receipt emails from the customer display and sale page, store
branch promo content for the idle screen, and fold selected tips into totals.
This commit is contained in:
isaacclad
2026-07-15 16:10:20 +00:00
parent 468346b183
commit 600aedb59d
20 changed files with 675 additions and 19 deletions
+48
View File
@@ -0,0 +1,48 @@
<?php
namespace App\Mail;
use App\Models\PosSale;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Address;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
class DigitalReceiptMail extends Mailable
{
use Queueable, SerializesModels;
public function __construct(public PosSale $sale)
{
$this->sale->loadMissing(['lines', 'location']);
}
public function envelope(): Envelope
{
$location = $this->sale->location;
$fromName = $location?->receipt_header
?: $location?->name
?: (string) config('mail.from.name', 'Ladill POS');
return new Envelope(
from: new Address(
(string) config('mail.from.address', 'receipts@ladill.com'),
$fromName,
),
subject: 'Your receipt '.$this->sale->reference.' from '.$fromName,
);
}
public function content(): Content
{
return new Content(
view: 'emails.digital-receipt',
with: [
'sale' => $this->sale,
'location' => $this->sale->location,
],
);
}
}