@if($selectedMessage)
@php $m = $selectedMessage; @endphp
{{-- ── Tabs ── --}}
{{-- Message tab --}}
{{-- Metadata --}}
- From
-
@if($m->sender_display && $m->sender_value && $m->sender_display !== $m->sender_value)
{{ $m->sender_display }}
<{{ $m->sender_value }}>
@else
{{ $m->sender_display ?: $m->sender_value ?: '—' }}
@endif
- To
-
@if($m->recipient_name && ($m->recipient_email ?: $m->recipient_phone))
{{ $m->recipient_name }}
<{{ $m->recipient_email ?: $m->recipient_phone }}>
@else
{{ $m->recipient_name ?: ($m->recipient_email ?: ($m->recipient_phone ?: '—')) }}
@endif
@if($m->reply_to)
- Reply-to
- {{ $m->reply_to }}
@endif
@if($m->template)
- Template
- {{ $m->template->name }}
@endif
- Sent by
-
@if($m->creator){{ $m->creator->name }}
@elseif($m->origin_type){{ $m->origin_type->label() }}
@else—@endif
@php
$stamps = array_filter([
'Queued' => $m->queued_at,
'Sent' => $m->sent_at,
'Delivered' => $m->delivered_at,
'Opened' => $m->opened_at,
'Failed' => $m->failed_at,
]);
@endphp
@foreach($stamps as $label => $ts)
- {{ $label }}
-
{{ $ts->format('d M Y, H:i') }}
({{ $ts->diffForHumans() }})
@endforeach
@if($m->failure_reason)
- Reason
- {{ $m->failure_reason }}
@endif
{{-- Body --}}
@if($m->channel->value === 'email')
@if($m->body_html)
{!! $m->body_html !!}
@elseif($m->body_text)
{{ $m->body_text }}
@else
No message body.
@endif
@else
{{ $m->body_text ?: '—' }}
@endif
{{-- Attachments --}}
@if($m->attachments->isNotEmpty())
Attachments ({{ $m->attachments->count() }})
@foreach($m->attachments as $att)
{{ $att->filename }}
@if($att->size)
{{ number_format($att->size / 1024, 1) }} KB
@endif
@endforeach
@endif
{{-- /message tab --}}
{{-- Events tab --}}
@if($m->events->isEmpty())
@else
@foreach($m->events->sortBy('occurred_at') as $event)
-
{{ $event->event_type->label() }}
@if($event->mapped_status)
→ {{ $event->mapped_status->label() }}
@endif
{{ $event->occurred_at?->format('d M Y, H:i:s') }}
({{ $event->occurred_at?->diffForHumans() }})
@if($event->provider_event_id)
{{ $event->provider_event_id }}
@endif
@endforeach
@endif
{{-- /events tab --}}