{{ __('whatsapp::app.whatsappNotificationSettings') }}

{{ __('whatsapp::app.configureWhatsappNotifications') }}

{{ __('whatsapp::app.staffNotifications') }}

{{ __('whatsapp::app.configureStaffNotifications') }}

@if($templates && count($templates) > 0) @foreach($templates as $template) @if(($template->category === 'staff' || in_array($template->notification_type, ['order_notifications', 'reservation_notification', 'payment_notification'])) && !in_array($template->notification_type, ['low_inventory_alert', 'inventory_alert', 'operations_summary', 'subscription_expiry_reminder'])) @php $key = $template->notification_type . '_staff'; $isEnabled = $this->notificationPreferences[$key] ?? false; @endphp
{{ $template->template_name }}

{{ $template->description }}

@endif @endforeach @else

{{ __('whatsapp::app.noTemplatesFound') }}

@endif

{{ __('whatsapp::app.automatedMessageSchedules') }}

{{ __('whatsapp::app.configureAutomatedMessages') }}

@php $templatesCollection = $templates ? collect($templates) : collect(); $automatedTemplates = $templatesCollection->where('category', 'automated'); // Only include operations_summary and subscription_expiry_reminder - low_inventory_alert is handled separately above $otherAutomated = $templatesCollection->whereIn('notification_type', ['subscription_expiry_reminder', 'operations_summary']); @endphp
@if($templatesCollection && $templatesCollection->count() > 0) {{-- Low Stock Alert - Special handling above other schedules --}} @php $lowStockTemplate = $templatesCollection->where('notification_type', 'low_inventory_alert')->first(); @endphp @if($lowStockTemplate) @php $key = 'low_inventory_alert'; $schedule = $this->automatedSchedules[$key] ?? [ 'is_enabled' => false, 'schedule_type' => 'every_5_minutes', 'scheduled_time' => null, 'scheduled_day' => '', 'roles' => [], ]; @endphp
{{ __('whatsapp::app.lowStockAlert') }}

{{ __('whatsapp::app.lowStockAlertDescription') }}

@if($schedule['is_enabled'])

Automatic inventory monitoring - no specific time needed

    @foreach($availableRoles as $role)
  • {{ $role['name'] }}
  • @endforeach @if(count($availableRoles) === 0)
  • {{ __('whatsapp::app.noRolesAvailable') }}
  • @endif
@endif
@endif {{-- Other Automated Schedules (excluding low_inventory_alert which is handled above) --}} @foreach($automatedTemplates->merge($otherAutomated) as $template) @php $key = $template->notification_type; // Skip low_inventory_alert as it's handled separately above if ($key === 'low_inventory_alert') { continue; } // Ensure schedule exists with defaults $schedule = $this->automatedSchedules[$key] ?? [ 'is_enabled' => false, 'schedule_type' => 'daily', 'scheduled_time' => '09:00', 'scheduled_day' => '', 'roles' => [], ]; $schedule['is_enabled'] = $schedule['is_enabled'] ?? false; $schedule['schedule_type'] = $schedule['schedule_type'] ?? 'daily'; $schedule['scheduled_time'] = $schedule['scheduled_time'] ?? '09:00'; $schedule['scheduled_day'] = $schedule['scheduled_day'] ?? ''; $schedule['roles'] = $schedule['roles'] ?? []; @endphp
{{ $template->template_name }}

{{ $template->description }}

@if(($schedule['is_enabled'] ?? false))
@if($key === 'low_inventory_alert')
Checks Every 5 Minutes

Automatic inventory monitoring - no specific time needed

    @foreach($availableRoles as $role)
  • {{ $role['name'] }}
  • @endforeach @if(count($availableRoles) === 0)
  • {{ __('whatsapp::app.noRolesAvailable') }}
  • @endif
@elseif($key !== 'operations_summary')
    @foreach($availableRoles as $role)
  • {{ $role['name'] }}
  • @endforeach @if(count($availableRoles) === 0)
  • {{ __('whatsapp::app.noRolesAvailable') }}
  • @endif
@else
    @foreach($availableRoles as $role)
  • {{ $role['name'] }}
  • @endforeach @if(count($availableRoles) === 0)
  • {{ __('whatsapp::app.noRolesAvailable') }}
  • @endif
@endif @if(($schedule['schedule_type'] ?? 'daily') === 'weekly')
@endif @if(($schedule['schedule_type'] ?? 'daily') === 'monthly')
@endif
@endif
@endforeach @else

No automated templates found

@endif

{{ __('whatsapp::app.reportSchedules') }}

{{ __('whatsapp::app.configureReportSchedules') }}

@php $reportTypes = [ 'daily_sales' => __('whatsapp::app.dailySalesReport'), 'weekly_sales' => __('whatsapp::app.weeklySalesReport'), 'monthly_sales' => __('whatsapp::app.monthlySalesReport'), ]; @endphp
@foreach($reportTypes as $reportType => $reportName) @php $schedule = $reportSchedules[$reportType] ?? [ 'is_enabled' => false, 'frequency' => str_replace('_sales', '', $reportType), 'scheduled_time' => '09:00', 'scheduled_day' => '', 'recipients' => [], ]; @endphp
{{ $reportName }}

{{ __('whatsapp::app.automaticReportDelivery') }}

@if($schedule['is_enabled'] ?? false)
    @foreach($availableRoles as $role)
  • {{ $role['name'] }}
  • @endforeach @if(count($availableRoles) === 0)
  • {{ __('whatsapp::app.noRolesAvailable') }}
  • @endif
@endif
@endforeach