@extends('layouts.user_type.auth') @section('marketingLabMailLog') @include('pages_admin.marketing._nav') @include('components.alert') @php $mailLogs = $mailLogs ?? ($logs ?? null); $mlPct = fn ($n) => $totalSent > 0 ? round($n / $totalSent * 100) . '% of sent' : 'No emails sent yet'; @endphp
Total sent
{{ number_format($totalSent) }}
All campaigns
Delivered
{{ number_format($totalDelivered) }}
{{ $mlPct($totalDelivered) }}
Opened
{{ number_format($totalOpened) }}
{{ $mlPct($totalOpened) }}
Clicked
{{ number_format($totalClicked) }}
{{ $mlPct($totalClicked) }}
Mail log
@if(isset($mailLogs) && method_exists($mailLogs, 'total')) {{ number_format($mailLogs->total()) }} emails @endif
@forelse($mailLogs ?? [] as $index => $log) @php $mlStatus = $log->status ?? ''; $mlTone = str_contains($mlStatus, 'clicked') ? 'z-badge--success' : (str_contains($mlStatus, 'opened') ? 'z-badge--warning' : (str_contains($mlStatus, 'delivered') ? 'z-badge--info' : (in_array($mlStatus, ['failed', 'bounced', 'spam', 'unsubscribed'], true) ? 'z-badge--danger' : ''))); @endphp @empty @endforelse
# Lab Subject Sent Status
{{ str_pad((method_exists($mailLogs, 'firstItem') ? $mailLogs->firstItem() + $index : $loop->iteration),2,'0',STR_PAD_LEFT) }}
{{ $log->lab_name ?? $log->laboratory_name ?? $log->marketingLab->laboratory_name ?? '—' }} {{ $log->email ?? $log->contact_email ?? '—' }}
{{ \Illuminate\Support\Str::limit($log->subject ?? '—', 50) }} @if ($log->campaign) {{ $log->campaign->name }} · email {{ $log->step_no }} @elseif (!empty($log->template)) {{ $log->template }}{{ $log->template !== 'campaign' ? ' · old bulk send' : '' }} @endif @if ($log->created_at) @php $mlAt = \Carbon\Carbon::parse($log->created_at); @endphp {{ $mlAt->format('d M Y') }}{{ $mlAt->format('h:i A') }} @else — @endif {{ ucfirst($log->status ?? 'Sent') }}
No mail logs
Emails sent from Marketing Labs will appear here.
@if(isset($mailLogs) && method_exists($mailLogs, 'links')) @include('components.pagination', ['paginator' => $mailLogs]) @endif
@endsection