@extends('layouts.user_type.auth') @section('emailLog')
@include('components.alert') @php $elTone = fn ($s) => match ($s) { 'sent' => 'z-badge--success', 'failed' => 'z-badge--danger', 'pending' => 'z-badge--warning', default => '' }; $elRate = $summary['total'] ? round($summary['sent'] / $summary['total'] * 100) : null; @endphp
Emails logged
{{ number_format($summary['total']) }}
Across {{ count($tenants) }} {{ \Illuminate\Support\Str::plural('workspace', count($tenants)) }}
Sent
{{ number_format($summary['sent']) }}
{{ $elRate !== null ? $elRate . '% delivery rate' : 'No emails yet' }}
Failed
{{ number_format($summary['failed']) }}
@if($summary['failed']) Show failures @else Nothing to fix @endif
Pending
{{ number_format($summary['pending']) }}
Queued, not yet handed to the mail server
All emails
Newest first. Hover a failure to read the full error.
{{ number_format($logs->total()) }} {{ \Illuminate\Support\Str::plural('email', $logs->total()) }}
@forelse($logs as $log) @php $elAt = $log->created_at ? \Carbon\Carbon::parse($log->created_at) : null; @endphp @empty @endforelse
Recipient Workspace Type Status Details Sent
{{ $log->customer_name ?: $log->customer_email }} {{ $log->customer_email }}
{{ $log->company_name }} {{ $log->type }} {{ ucfirst($log->status) }}
{{ $log->error_message ?: ($log->status === 'sent' ? 'Delivered to the mail server' : '—') }}
@if($elAt) {{ $elAt->format('d M Y') }}{{ $elAt->format('H:i:s') }} @else — @endif
{{ request()->hasAny(['search', 'status', 'type', 'tenant']) ? 'No emails match these filters' : 'No emails logged yet' }}
Emails appear here as soon as a workspace sends them.
@if(request()->hasAny(['search', 'status', 'type', 'tenant'])) @endif
@include('components.pagination', ['paginator' => $logs])
@endsection