@php $notifType = $notifType ?? ''; $details = $details ?? []; $amountFmt = 'CA$' . number_format((float) ($details['amount'] ?? 0), 2); $meta = [ 'invoice_created' => ['heading' => 'New Invoice', 'intro' => "A new invoice has been created for your child's classes at " . config('company.short') . '.', 'preheader' => 'A new invoice has been created — Balance ' . $amountFmt, 'cta' => 'View & Pay'], 'payment_reminder' => ['heading' => 'Payment Reminder', 'intro' => 'This is a friendly reminder that you have an outstanding payment due.', 'preheader' => 'Payment reminder — ' . $amountFmt . ' due ' . ($details['dueDate'] ?? ''), 'cta' => 'Pay Now'], 'payment_received' => ['heading' => 'Payment Received', 'intro' => "We've received your payment. Thank you!", 'preheader' => 'Payment of ' . $amountFmt . ' received. Thank you!', 'cta' => null], ]; $m = $meta[$notifType] ?? ['heading' => config('company.short') . ' Notification', 'intro' => '', 'preheader' => '', 'cta' => null]; $rows = []; if (!empty($details['invoiceNumber'])) $rows[] = ['label' => 'Invoice #', 'value' => e($details['invoiceNumber'])]; if (!empty($details['studentName'])) $rows[] = ['label' => 'Student', 'value' => e($details['studentName'])]; $rows[] = ['label' => 'Amount', 'value' => $amountFmt]; if (isset($details['remaining'])) $rows[] = ['label' => 'Balance Due', 'value' => 'CA$' . number_format((float) $details['remaining'], 2)]; if (!empty($details['dueDate'])) $rows[] = ['label' => 'Due Date', 'value' => e($details['dueDate'])]; if (!empty($details['transactionId']))$rows[] = ['label' => 'Reference', 'value' => e($details['transactionId'])]; @endphp @extends('emails.layouts.stepup', ['preheader' => $m['preheader'], 'heading' => $m['heading']]) @section('body')
Hi {{ $recipientName }},
{{ $m['intro'] }}
@if($notifType === 'payment_received' && isset($details['remaining']) && (float) $details['remaining'] <= 0)All invoices are now fully paid.
@endif @endsection @section('summary') @include('emails.components.summary-table', ['title' => 'Invoice Summary', 'rows' => $rows]) @endsection @if(!empty($m['cta']) && !empty($details['portalUrl'])) @section('cta') @include('emails.components.button', ['label' => $m['cta'], 'url' => $details['portalUrl']]) @endsection @endif