@extends('admin.layouts.app') @section('content')

Statistiques des Emails

Période d'analyse

Total des emails

{{ number_format($stats['total']) }}

Sur les {{ $days }} derniers jours

Envoyés

{{ number_format($stats['sent']) }}

@if($stats['total'] > 0) {{ round(($stats['sent'] / $stats['total']) * 100, 1) }}% du total @else 0% du total @endif

Échoués

{{ number_format($stats['failed']) }}

@if($stats['total'] > 0) {{ round(($stats['failed'] / $stats['total']) * 100, 1) }}% du total @else 0% du total @endif

Taux de réussite

{{ $stats['success_rate'] }}%

Emails envoyés avec succès

Statistiques par type

@if(isset($stats['by_type']) && count($stats['by_type']) > 0)
@foreach($stats['by_type'] as $type => $count) @endforeach
Type Nombre Pourcentage
{{ ucfirst(str_replace('_', ' ', $type)) }} {{ number_format($count) }} {{ round(($count / $stats['total']) * 100, 1) }}%
@else

Aucune donnée disponible

@endif

Statistiques par catégorie

@if(isset($stats['by_category']) && count($stats['by_category']) > 0)
@foreach($stats['by_category'] as $category => $count) @endforeach
Catégorie Nombre Pourcentage
{{ ucfirst($category) }} {{ number_format($count) }} {{ round(($count / $stats['total']) * 100, 1) }}%
@else

Aucune donnée disponible

@endif

Évolution quotidienne

@if($dailyStats->count() > 0)
@foreach($dailyStats as $stat) @endforeach
Date Total Envoyés Échoués Taux de réussite
{{ \Carbon\Carbon::parse($stat->date)->format('d/m/Y') }}
{{ \Carbon\Carbon::parse($stat->date)->locale('fr')->isoFormat('dddd') }}
{{ number_format($stat->total) }} {{ number_format($stat->sent) }} {{ number_format($stat->failed) }} @if($stat->total > 0) @php $successRate = round(($stat->sent / $stat->total) * 100, 1); @endphp {{ $successRate }}% @else N/A @endif
@else
Aucune donnée disponible

Aucun email n'a été envoyé durant cette période

@endif
@if(isset($stats['top_recipients']) && $stats['top_recipients']->count() > 0)

Top 10 des destinataires

@foreach($stats['top_recipients'] as $index => $recipient) @endforeach
Position Email Nombre d'emails
@if($index === 0) 1 @elseif($index === 1) 2 @elseif($index === 2) 3 @else {{ $index + 1 }} @endif
{{ $recipient->to_email }}
{{ number_format($recipient->count) }}
@endif
@endsection