@extends('layouts.dashboard') @section('content') @php /** * SMS delivery log — every text the gateway sent, every one the provider refused, and every * one that never left the building. The sibling of the email log for the other channel. * * `blocked` is its own outcome on purpose: "we never called the provider" and "the provider * said no" are different problems with different fixes, and one shared "failed" hides which * one an operator is looking at. There is no resend action — see SmsLogController. * * @var array $rows the current page, newest first * @var array $counts ['sent'=>int,'failed'=>int,'blocked'=>int] across the whole log * @var int $segments billed segments across every delivered message * @var int $total rows matching the active filter * @var array $pagination paginate() metadata * @var string $status active status filter ('' = all) * @var string $purpose active purpose filter ('' = all) * @var string $q active search term * @var array $purposes the purposes the gateway sends * @var string $reason why sending is not possible right now ('' = the gateway is ready) */ $statusPill = [ 'sent' => 'qm-pill-green', 'failed' => 'qm-pill-red', 'blocked' => 'qm-pill-amber', ]; $statusLabel = [ 'sent' => t_raw('admin.sms_log.status_sent'), 'failed' => t_raw('admin.sms_log.status_failed'), 'blocked' => t_raw('admin.sms_log.status_blocked'), ]; $hasFilters = $status !== '' || $purpose !== '' || $q !== ''; $delivered = (int) $counts['sent']; $attempted = $delivered + (int) $counts['failed']; @endphp @php /* .qm-d2: the dashboard density standard (app.css §35) */ @endphp
| {{ t_raw('admin.sms_log.col_recipient') }} | {{ t_raw('admin.sms_log.col_message') }} | {{ t_raw('common.status') }} | {{ t_raw('admin.sms_log.col_segments') }} | {{ t_raw('admin.sms_log.col_when') }} |
|---|---|---|---|---|
|
{{ $r['to_number'] }}
@php // Who the message belongs to: the purpose always, and the restaurant
// when it is one restaurant's (the table-ready alert).
@endphp
{!! $pu !== '' ? t('admin.sms_log.purpose_' . $pu) : '—' !!}{!! !empty($r['restaurant_name']) ? ' · ' . e((string) $r['restaurant_name']) : '' !!}
|
{{ $r['body'] }} | {{ $statusLabel[$st] ?? $st }} @if ($st !== 'sent' && !empty($r['error'])) @php // The provider's own sentence, verbatim. On a trial account "the number is // unverified" is the whole answer, and paraphrasing it loses it. @endphp {{ $r['error'] }} @endif | {{ (int) $r['segments'] }} | {!! fmt_datetime($r['sent_at'] ?: $r['created_at']) !!} |