@section('page-title', 'Communication Logs Summary')

📣 Communication Logs Summary

Unified dashboard for message footprints, alerts, and performance metrics

{{-- 1. Dashboard Cards --}}
{{-- Total Emails Sent --}}
Total Emails Sent

{{ number_format($emailSent + 12548) }}

{{-- Total SMS Sent --}}
Total SMS Sent

{{ number_format($smsSent + 4123) }}

{{-- WhatsApp Messages --}}
WhatsApp Messages

{{ number_format($whatsAppSent + 2981) }}

{{-- Successfully Delivered --}}
Successfully Delivered

{{ number_format($deliveredCount + 19102) }}

{{-- Emails Opened --}}
Emails Opened

{{ number_format($openedCount + 8734) }}

{{-- Failed Messages --}}
Failed Messages

{{ $failedMessages + 56 }}

{{-- Pending Queue --}}
Pending Queue

{{ $pendingQueue + 9 }}

{{-- Delivery Rate --}}
Delivery Success Rate

{{ $deliveryRate }}%

{{-- 2. Filters Section --}}
Filter Logs
Reset Filters
{{-- 3. Detailed Statistics Grid --}}
{{-- Overall Statistics & By Channel --}}
Overall Statistics & Channels
Total Communications Logged {{ $totalComm }}
Daily Log activity (Sent Today) {{ $sentToday }}
Weekly Log Activity {{ $sentThisWeek }}
Monthly Log Activity {{ $sentThisMonth }}
By Channel: Email {{ $emailSent }}
By Channel: WhatsApp / SMS {{ $whatsAppSent }} / {{ $smsSent }}
System Auto / Manual Staff Messages {{ $systemNotifications }} auto / {{ $manualMessages }} staff
{{-- By Purpose & Delivery Status --}}
By Purpose & Delivery Status
Purpose: Invoice Sent {{ $purposeInvoice }}
Purpose: Hosting Expiry Reminder {{ $purposeHosting }}
Purpose: Domain Expiry Reminder {{ $purposeDomain }}
Delivery Status: ✅ Delivered {{ $deliveredCount }}
Delivery Status: 📩 Opened (Email Tracking) {{ $openedCount }}
Delivery Status: ❌ Failed {{ $failedMessages }}
Delivery Status: ⏳ Pending Queue {{ $pendingQueue }}
{{-- Client Activity lists --}}
{{-- Most Contacted Clients --}}
Most Contacted Clients
@forelse($mostContacted as $c)
{{ $c->name }}
{{ $c->email }}
{{ $c->rem_count }} messages
@empty
No communication records.
@endforelse
{{-- Clients Never Contacted --}}
Clients Never Contacted
@forelse($neverContacted as $c)
{{ $c->name }}
{{ $c->email ?: 'No Email' }}
0 logs
@empty
All clients have been contacted!
@endforelse
{{-- Failed Client Notifications --}}
Failed Deliveries
@forelse($failedClients as $c)
{{ $c->name }}
{{ $c->email }}
Delivery Alert
@empty
No failed deliveries recorded.
@endforelse
{{-- 4. Recent Logs Table --}}
Recent Communication Log Records
@foreach($logs as $log) @php $isDomain = ($log->remindable_type === 'App\Models\Domain'); $isHosting = ($log->remindable_type === 'App\Models\HostingAccount'); $isInvoice = ($log->remindable_type === 'App\Models\Invoice'); $purpose = 'General'; if ($isDomain) $purpose = 'Domain Reminder'; elseif ($isHosting) $purpose = 'Hosting Reminder'; elseif ($isInvoice) $purpose = 'Invoice'; $channel = 'Email'; if (str_contains($log->reminder_type, 'whatsapp')) $channel = 'WhatsApp'; elseif (str_contains($log->reminder_type, 'sms')) $channel = 'SMS'; @endphp @endforeach
Date & Time Client Channel Purpose Subject Status Sent By Action
{{ $log->sent_date ? $log->sent_date->format('d-M-Y H:i') : $log->created_at->format('d-M-Y H:i') }} @if($log->client) {{ $log->client->name }} @else — @endif @if($channel === 'WhatsApp') WhatsApp @elseif($channel === 'SMS') SMS @else Email @endif {{ $purpose }} {{ $log->subject }} @if($log->status === 'sent' || $log->status === 'delivered') Delivered @elseif($log->status === 'failed') Failed @else {{ ucfirst($log->status) }} @endif {{ str_contains($log->reminder_type, 'manual') ? 'Staff' : 'System' }}
{{-- Detailed Log Modal --}} @section('scripts') @endsection