@php $stock = $lowStockItems[0]['stock']; $isOutOfStock = $stock <= 0; $isCritical = $stock > 0 && $stock <= \App\Models\ProductVariation::CRITICAL_STOCK_THRESHOLD; $isLow = $stock > \App\Models\ProductVariation::CRITICAL_STOCK_THRESHOLD && $stock <= \App\Models\ProductVariation::LOW_STOCK_THRESHOLD; $headerColor = $isOutOfStock ? '#dc3545' : ($isCritical ? '#dc3545' : '#ffc107'); $headerIcon = $isOutOfStock ? '❌' : ($isCritical ? '⚠️' : '⚠️'); $headerText = $isOutOfStock ? 'Out of Stock Alert' : ($isCritical ? 'Critical Stock Alert' : 'Low Stock Alert'); $stockColor = $isOutOfStock ? '#dc3545' : ($isCritical ? '#dc3545' : '#ffc107'); @endphp

{{ $headerIcon }} {{ $headerText }}

@if($isOutOfStock) The following product is out of stock and requires immediate attention: @elseif($isCritical) The following product has reached critical stock level and requires urgent attention: @else The following product is running low on stock and requires your attention: @endif

Product: {{ $lowStockItems[0]['product']->title }}
Variation: {{ $lowStockItems[0]['variation']->unit_value }} {{ $lowStockItems[0]['variation']->unit_type }}
Current Stock: {{ $stock }} units @if($isOutOfStock) (Out of Stock) @elseif($isCritical) (Critical Level) @else (Low Stock) @endif
@if($isOutOfStock) Replenish Stock Now @elseif($isCritical) Update Stock Urgently @else Update Stock Level @endif

Note: @if($isOutOfStock) This product is currently out of stock. Immediate action is required to prevent loss of sales. @elseif($isCritical) Stock has reached a critical level. Quick action is needed to prevent stockout. @else Please update the stock levels to ensure product availability and prevent potential stockouts. @endif

This is an automated notification from {{ config('app.name') }}