@php /** Safe defaults (all optional vars guarded) */ $purpose = $purpose ?? null; $brand = $brand ?? null; $amountCents = isset($amountCents) ? (int)$amountCents : null; $holdCents = isset($holdCents) ? (int)$holdCents : null; $invoiceNumber = $invoiceNumber ?? null; $invoiceUrl = $invoiceUrl ?? null; $payUrl = isset($payUrl) ? (string)$payUrl : '#'; // Brand / logo $brandName = $brand?->short_name ?? 'Jimny NZ / Dream Drives'; $logo = $brand?->email_logo_url ?? null; // Currency + formatting $ccy = strtoupper($job?->currency ?? 'NZD'); $symbols = ['NZD'=>'NZ$','AUD'=>'A$','USD'=>'$','GBP'=>'£','EUR'=>'€','CAD'=>'C$']; $sym = $symbols[$ccy] ?? $ccy; $fmt = fn ($c) => $sym . number_format(((int)$c)/100, 2); // Labels / identifiers $label = !empty($purpose) ? ucfirst((string)$purpose) : 'Payment'; $ref = $job?->external_reference ?? ($job?->id ? ('#'.$job->id) : '—'); $name = trim((string)($job?->customer_name ?? 'there')); // Dates $formatDt = function($v, $format='D d M Y, H:i'){ try { if ($v instanceof \Illuminate\Support\Carbon || $v instanceof \Carbon\Carbon) return $v->format($format); return $v ? \Carbon\Carbon::parse($v)->format($format) : null; } catch (\Throwable $e) { return null; } }; $startTxt = $formatDt($job?->start_at); $endTxt = $formatDt($job?->end_at); // Determine hold (only show if > 0) if ($holdCents === null) { $holdCents = (int)( optional($job?->deposit)->authorized_cents ?? ($job->hold_amount_cents_from_flow ?? optional($job?->flow)->hold_amount_cents ?? 0) ); } @endphp
@if($logo) {{ $brandName }} @else {{ $brandName }} @endif

Secure {{ strtolower($label) }}

Hi {{ $name }},

We’ve set up a secure payment link for your booking {{ $ref }} with {{ $brandName }}.

@if(isset($amountCents))

Please pay {{ $fmt($amountCents) }} to confirm your reservation.

@else

Please follow the link below to complete payment.

@endif

Pay now

If the button doesn’t work, copy and paste this link:
{{ $payUrl }}

Reservation Summary

Reservation reference
{{ $ref }}
Name
{{ $job?->customer_name ?? '—' }}
Email
@if(!empty($job?->customer_email)) {{ $job->customer_email }} @else — @endif
Phone
{{ $job?->customer_phone ?? '—' }}
@if($startTxt || $endTxt)
Start
{{ $startTxt ?? '—' }}
End
{{ $endTxt ?? '—' }}
@endif @if(isset($amountCents))
Amount due
{{ $fmt($amountCents) }} ({{ $ccy }})
@endif @if(!empty($invoiceNumber) || !empty($invoiceUrl))
Invoice
@if(!empty($invoiceNumber)) {{ $invoiceNumber }} @endif @if(!empty($invoiceNumber) && !empty($invoiceUrl))  —  @endif @if(!empty($invoiceUrl)) View online @endif
@endif
@if(($holdCents ?? 0) > 0)
About the refundable security hold

A refundable security hold of {{ $fmt($holdCents) }} may appear as “pending” on your card. It isn’t a charge. We release it after the vehicle is returned, in line with our policy. Depending on your bank, the pending authorisation may take a few days to disappear.

@endif

If your booking details change, we may issue a new link.

Thanks,
{{ $brandName }}