@extends('setting.nav') @section('title', 'Auto Reply Templates') @section('content')
@include('auto_reply._tabs') @php $isAdmin = auth()->check() && auth()->user()->auth_id == 0; $filters = [ null => 'All (' . $counts['all'] . ')', 'approved' => 'Approved (' . $counts['approved'] . ')', 'draft' => 'Draft (' . $counts['draft'] . ')', 'inactive' => 'Inactive (' . $counts['inactive'] . ')', ]; @endphp
@foreach ($filters as $key => $label) {{ $label }} @endforeach
@if ($isAdmin) New template @endif
@forelse ($templates as $template) @empty @endforelse
Template Category Subject Status Last updated Actions
{{ $template->name }} @if ($template->category_id && isset($categories[$template->category_id])) {{ $categories[$template->category_id]->name }} @else — @endif {{ \Illuminate\Support\Str::limit($template->subject, 60) }} @php $colour = match ($template->status) { \App\Models\EmailTemplate::STATUS_APPROVED => 'success', \App\Models\EmailTemplate::STATUS_DRAFT => 'warning text-dark', default => 'secondary', }; @endphp {{ $template->statusLabel() }} {{ optional($template->updated_at)->format('d M Y, H:i') }} @if ($isAdmin) Edit @if ($template->status !== \App\Models\EmailTemplate::STATUS_APPROVED)
@csrf
@else
@csrf
@endif @else View only @endif
No templates yet. A category cannot auto-reply without an approved template.
@endsection