{{-- Flash success --}} @if(session('success'))
{{ session('success') }}
@endif @php $getSetting = function($key, $default = '') { static $cache = null; if ($cache === null) { try { $cache = \Illuminate\Support\Facades\DB::table('system_settings')->pluck('value', 'key')->toArray(); } catch (\Exception $e) { $cache = []; } } return $cache[$key] ?? $default; }; @endphp {{-- Email Notifications --}}
@csrf

{{ __('Email Notifications') }}

{{ __('Choose which events trigger email alerts to admin') }}

@php $emailEvents = [ ['key' => 'notify_new_user', 'label' => __('New User Registration'), 'desc' => __('When a new user signs up for the platform'), 'default' => 'true'], ['key' => 'notify_payment_success', 'label' => __('Successful Payment'), 'desc' => __('When a subscription payment is processed successfully'), 'default' => 'true'], ['key' => 'notify_payment_failed', 'label' => __('Failed Payment'), 'desc' => __('When a subscription payment fails or is declined'), 'default' => 'true'], ['key' => 'notify_new_ticket', 'label' => __('New Support Ticket'), 'desc' => __('When a user creates a new support ticket'), 'default' => 'true'], ['key' => 'notify_system_alert', 'label' => __('System Alert'), 'desc' => __('Critical system errors, high resource usage, or downtime'), 'default' => 'true'], ['key' => 'notify_plan_change', 'label' => __('Plan Upgrade/Downgrade'), 'desc' => __('When a user changes their subscription plan'), 'default' => 'false'], ['key' => 'notify_user_suspension', 'label' => __('User Suspension'), 'desc' => __('When a user account is suspended or banned'), 'default' => 'true'], ['key' => 'notify_ai_budget', 'label' => __('AI Budget Alert'), 'desc' => __('When AI spending reaches the configured threshold'), 'default' => 'true'], ['key' => 'notify_high_bounce', 'label' => __('High Bounce Rate'), 'desc' => __('When email bounce rate exceeds 5%'), 'default' => 'false'], ['key' => 'notify_daily_summary', 'label' => __('Daily Summary Report'), 'desc' => __('Receive a daily digest of platform activity'), 'default' => 'false'], ]; @endphp @foreach($emailEvents as $event) @php $isEnabled = $getSetting($event['key'], $event['default']) === 'true'; @endphp

{{ $event['label'] }}

{{ $event['desc'] }}

@endforeach
{{-- Slack Notifications --}}
@csrf

{{ __('Slack Notifications') }}

{{ __('Send alerts to your Slack workspace') }}

@php $slackEvents = [ ['key' => 'slack_notify_new_user', 'label' => __('New User Registration'), 'default' => 'true'], ['key' => 'slack_notify_payment_failed', 'label' => __('Failed Payment'), 'default' => 'true'], ['key' => 'slack_notify_new_ticket', 'label' => __('New Support Ticket'), 'default' => 'true'], ['key' => 'slack_notify_system_alert', 'label' => __('System Alert'), 'default' => 'true'], ['key' => 'slack_notify_ai_budget', 'label' => __('AI Budget Alert'), 'default' => 'false'], ]; @endphp @foreach($slackEvents as $se) @php $seEnabled = $getSetting($se['key'], $se['default']) === 'true'; @endphp
{{ $se['label'] }}
@endforeach
{{-- Admin Email Recipients --}}
@csrf

{{ __('Admin Email Recipients') }}

{{ __('Comma-separated list of emails that receive admin notifications') }}

{{ __('One email per line or comma-separated. These addresses receive all enabled admin notifications.') }}