{{-- Receivers of one sendout (#2957 slice 3a, card #3017). Included by sendout/receivers only. Expects: $data (paginator of Stat), $links (clicked urls, url => url), $sendout. Filter form: same GET parameters as before (status, link, plus the hidden sendout_id). Table: DESIGN.md data table, stacked labelled rows below 700 px. Status words are the old ones (sendout.sent/opened/bounced/queued/queuedRetry); the old warning, flag and "?" icons became words with the long explanation in the title. --}} @php $data->appends(request()->except('company_id')); $data->loadMissing(['receiver', 'queue']); $status = request()->filled('status') ? (string) request('status') : null; $link = request()->filled('link') ? (string) request('link') : null; $statusOptions = [ 0 => __('sendout.form.statusSent'), 2 => __('sendout.form.statusOpened'), 1 => __('sendout.form.statusBounced'), ]; $bounceType = \App\Models\StatEvent::$eventTypes['bounce']; @endphp
{{ __('sendout.receivers.filter') }}
@if (($cooldownSkips ?? 0) > 0) {{ trans('automatic_replies.skipped_title', ['count' => $cooldownSkips]) }}

{{ trans('automatic_replies.no_replay') }}

@endif @if ($data->isEmpty()) {{ __('sendout.receivers.noMatchText') }} @else @foreach ($data as $stat) @php $receiver = $stat->receiver; @endphp @endforeach
{{ __('sendout.receivers.columnReceiver') }}{{ __('sendout.receivers.columnStatus') }}
@if ($receiver){{ $receiver->email }}@if ($receiver->hard_bounced_at){{ __('receiver.hard_bounce') }}@elseif (! is_null($receiver->inactivated_at)) {{ __('sendout.receivers.inactivated') }}@endif @else{{ __('receiver.deleted') }}@endif @if ($receiver && $receiver->isBlacklisted()) {{ __('sendout.receivers.blacklisted') }} @elseif (($cooldownSkippedReceiverIds ?? collect())->contains($stat->receiver_id)) {{ trans('automatic_replies.skipped') }} @elseif (is_null($stat->send_time)) @if ($receiver && is_null($receiver->consent)) {{ __('sendout.receivers.noConsent') }} @elseif (! is_null($stat->queue) && $stat->queue->penalty != 0) {{ __('sendout.queuedRetry') }} {{ __('sendout.queuedRetryDescription') }} @else {{ __('sendout.queued') }} @endif @elseif ($stat->status == 1) {{ __('sendout.bounced') }} @php $bounceEvent = $stat->events()->where('type', $bounceType)->orderBy('id', 'desc')->first(); $bounceReason = $bounceEvent ? \App\Models\StatEvent::bounceTypeName($bounceEvent->sub_type) : null; @endphp @if ($bounceReason) ({{ __('sendout.bounceReasons.'.$bounceReason) }}) @endif @elseif ($stat->status == 2) {{ __('sendout.opened') }} @else {{ __('sendout.sent') }} @endif
{{ __('sendout.receivers.count', ['count' => formatNumber($data->total())]) }}
@endif