@php // Branded HTML-only invoice email — NO PDF attachment (see the // matching change in InvoiceController::sendInvoice). The body is a // short cover message with a summary table; the recipient downloads // the PDF from the Invoice View / portal if they want it. This keeps // Gmail from clipping the message and removes the extra attachment // noise the spec called out. $total = (float) ($total ?? 0); $balance = (float) ($balance ?? 0); $paid = max(0, $total - $balance); $studentName = trim(($invoice->student->first_name ?? '') . ' ' . ($invoice->student->last_name ?? '')); $dueDate = $invoice->dueDate ? \Carbon\Carbon::parse($invoice->dueDate)->format('M j, Y') : null; $rows = [ ['label' => 'Invoice #', 'value' => e($invoice->invoiceNumber ?? '-')], ]; if ($studentName !== '') $rows[] = ['label' => 'Student', 'value' => e($studentName)]; $rows[] = ['label' => 'Amount', 'value' => 'CA$' . number_format($total, 2)]; $rows[] = ['label' => 'Paid', 'value' => 'CA$' . number_format($paid, 2)]; $rows[] = ['label' => 'Balance Due', 'value' => 'CA$' . number_format($balance, 2)]; if ($dueDate) $rows[] = ['label' => 'Due Date', 'value' => e($dueDate)]; @endphp @extends('emails.layouts.stepup', [ 'preheader' => 'Invoice ' . ($invoice->invoiceNumber ?? '') . ' — Balance due CA$' . number_format($balance, 2) . '.', ]) @section('body')
Hello{{ !empty($parent['name']) ? ' ' . $parent['name'] : '' }},
Please find attached invoice {{ $invoice->invoiceNumber }}@if($studentName !== '') for {{ $studentName }}@endif.
Balance due: CA${{ number_format($balance, 2) }}
Thank you for choosing {{ config('company.name') }}.
@endsection @section('summary') @include('emails.components.summary-table', ['title' => 'Invoice Summary', 'rows' => $rows]) @endsection