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

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

@foreach($notificationSections as $section)

{{ $section['title'] }}

{{ $section['description'] }}

@if(collect($section['templates'])->count() > 0) @foreach($section['templates'] as $template) @php $key = $template->notification_type . '_' . $section['recipient']; @endphp
{{ $template->template_name }}

{{ $template->description }}

@endforeach @else

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

@endif
@endforeach

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

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

@if($templates && collect($templates)->count() > 0) {{-- Low Stock Alert - Special handling above other schedules --}} @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 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)
@if(($schedule['frequency'] ?? 'daily') === 'weekly')
@endif @if(($schedule['frequency'] ?? 'daily') === 'monthly')
@endif
    @foreach($availableRoles as $role)
  • {{ $role['name'] }}
  • @endforeach @if(count($availableRoles) === 0)
  • {{ __('whatsapp::app.noRolesAvailable') }}
  • @endif
@endif
@endforeach