@extends('layouts.app') @section('title', $campaign->name) @section('content') @php $counts = collect([ 'pending' => $campaign->recipients->where('status', 'pending')->count(), 'sent' => $campaign->recipients->where('status', 'sent')->count(), 'failed' => $campaign->recipients->where('status', 'failed')->count(), 'bounced' => $campaign->recipients->where('status', 'bounced')->count(), ]); $total = $counts->sum(); $delivered = $counts['sent'] + $counts['failed'] + $counts['bounced']; $progress = $total > 0 ? round(($delivered / $total) * 100, 1) : 0; $statusClass = match ($campaign->status) { 'running' => 'warn', 'completed' => 'ok', 'paused' => 'badge', default => 'muted', }; $statusLabel = match ($campaign->status) { 'running' => '● Running', 'completed' => 'Completed', 'paused' => 'Paused', default => 'Draft', }; @endphp @if ($campaign->status === 'running') @endif

{{ $campaign->name }}

{{ $statusLabel }}   Sender: {{ $campaign->sender->name }} <{{ $campaign->sender->email }}>  ·  Template: {{ $campaign->emailTemplate->name }}
@if (in_array($campaign->status, ['draft', 'paused'], true))
@csrf
@endif @if ($campaign->status === 'running')
@csrf
@endif View Report

Delivery Progress

{{ $progress }}%
Pending
{{ number_format($counts['pending']) }}
Sent
{{ number_format($counts['sent']) }}
Failed
{{ number_format($counts['failed']) }}
Bounced
{{ number_format($counts['bounced']) }}
@if ($campaign->target_count)
Campaign Target
{{ number_format($counts['sent']) }} / {{ number_format($campaign->target_count) }}
{{ round(($counts['sent'] / max(1, $campaign->target_count)) * 100, 1) }}% of target
@endif

Recipients ({{ number_format($total) }})

@foreach ($campaign->recipients as $recipient) @endforeach
Email Status Sent At Error
{{ $recipient->contact->email }} @php $rc = match ($recipient->status) { 'sent' => 'ok', 'failed', 'bounced' => 'danger', default => 'muted', }; $rl = ucfirst($recipient->status); @endphp {{ $rl }} {{ $recipient->sent_at?->format('Y-m-d H:i:s') ?? '—' }} {{ $recipient->error_message ?? '—' }}
@endsection