@php $fromLabel = $call['from_name'] ? $call['from_name'].' ('.$call['from'].')' : ($call['from'] ?? 'Unknown'); $toLabel = $call['to_name'] ? $call['to_name'].' ('.$call['to'].')' : ($call['to'] ?? 'Unknown'); $dur = (int) ($call['duration'] ?? 0); $durFmt = $dur >= 3600 ? gmdate('H:i:s', $dur) : gmdate('i:s', $dur); $dirLabel = match($call['direction'] ?? '') { 'IN' => 'Inbound', 'OUT' => 'Outbound', 'INT' => 'Internal', default => '—', }; $when = !empty($call['datetime']) ? \Illuminate\Support\Carbon::parse($call['datetime'])->format('d M Y, H:i:s') : '—'; @endphp @extends('emails.layouts.base', [ 'subject' => 'Call Recording: ' . $fromLabel . ' → ' . $toLabel, 'title' => 'Call Recording Shared', 'subtitle' => $sentBy . ' has shared a call recording with you.', 'icon' => '🎧', 'iconColor' => '#3b82f6', ]) @section('content')
@if(!empty($call['extension'])) @endif @if(!empty($call['disposition'])) @endif
From {{ $fromLabel }}
To {{ $toLabel }}
Direction {{ $dirLabel }}
Extension {{ $call['extension'] }}
Date / Time {{ $when }}
Duration {{ $durFmt }}
Status {{ $call['disposition'] }}
{{-- Reason this recording is being shared (also stored in the audit trail) --}}
Reason for sharing
{{ $reason }}
@if(!empty($note))
Message from {{ $sentBy }}
{{ $note }}
@endif @if(!empty($summary))
✨ AI Summary
{{ $summary }}
@endif @if(!empty($transcript))
📝 Transcript
{{ $transcript }}
@endif @if($hasAttachment ?? false)

📎 The call recording audio file is attached to this email.

@else

⚠ The audio file could not be attached. Please contact your administrator.

@endif

🔒 This recording was shared by {{ $sentBy }}. Access to call recordings is logged for privacy and compliance. Please handle this audio responsibly and in line with your organisation's data-protection policy.

@endsection