WhatsApp Templates
@php $lastSynced = $templates->max('content_synced_at'); @endphp @if ($lastSynced) Last synced with Twilio {{ $lastSynced->diffForHumans() }} @else Never synced with Twilio @endif
{{ $approvalCounts['approved'] ?? 0 }} Approved
{{ $approvalCounts['rejected'] ?? 0 }} Rejected
{{ ($approvalCounts['pending'] ?? 0) + ($approvalCounts['received'] ?? 0) }} Pending
{{ $templates->whereNull('content_sid')->count() }} Not Linked
@foreach ($templates as $template)
@endforeach
{{ $template->name }} {{ $template->slug }} {{ $template->approvalLabel() }} @if ($template->approval_category) {{ $template->approval_category }} @endif
@if ($template->content_sid){{ $template->content_sid }}
@endif
@if ($template->approval_status === 'rejected')
Rejected by WhatsApp{{ $template->rejection_reason ? ': ' . $template->rejection_reason : '.' }}
Messages using this template will not be delivered.
@elseif (!$template->content_sid)
Not linked to a Twilio template - sends as freeform text, which only
works within the 24-hour customer service window.
@endif
@php
$openBrace = '{' . '{';
$closeBrace = '}' . '}';
$previewContent = preg_replace('/\{(\w+)\}/', $openBrace . '$1' . $closeBrace, $template->content);
@endphp
{{ $previewContent }}
@if ($template->variables)
Variables:
@foreach ($template->variables as $variable)
{{ '{' }}{{ '{' }} {{ $variable }} {{ '}' }}{{ '}' }}
@endforeach
@endif
WhatsApp Statistics
{{ $stats['total_sent'] ?? 0 }}
Total Sent
{{ $stats['total_failed'] ?? 0 }}
Failed
{{ $stats['today_sent'] ?? 0 }}
Today
{{ $stats['this_month_sent'] ?? 0 }}
This Month