@extends('layouts.app') @section('title', 'Email Templates') @section('page-title', 'Email Templates') @push('styles') @endpush @section('content') {{-- Global Email Settings --}}
Global Email Settings
@csrf @method('PATCH')
When disabled, no automated emails are sent.
{{-- Send Test Email --}}
Send Test Email
@csrf
Placeholders will be filled with sample values like [placeholder_name].
{{-- Templates --}}
Email Templates

Edit subject and body. Use @{{token_name}} tokens shown in each template.

@foreach($templates as $tpl)
{{ $tpl->name }} @php $badgeClass = $tpl->is_active ? 'bg-success bg-opacity-10 text-success' : 'bg-secondary bg-opacity-10 text-secondary'; @endphp {{ $tpl->is_active ? 'Active' : 'Inactive' }}
@csrf @method('PATCH')
@if($tpl->placeholders && count($tpl->placeholders))
Available Placeholders — click any token to copy it
@foreach($tpl->placeholders as $token) @php $tokenText = '{{' . $token . '}}'; @endphp @endforeach
@endif
@csrf @method('PATCH')
@endforeach {{-- Recent Email Log --}}
Recent Email Log
@forelse($recentLogs as $log) @empty @endforelse
Recipient Template Subject Status Sent At
{{ $log->recipient_email }} {{ $templateNames[$log->template_key] ?? $log->template_key }} {{ $log->subject }} @if($log->status === 'sent') Sent @else Failed @endif {{ $log->sent_at->format('d M Y, h:i A') }}
No emails sent yet.
@endsection @push('scripts') @endpush