@php $pct = (int) ($info['used_pct'] ?? 0); $isCritical = ($info['severity'] ?? 'warning') === 'critical'; $mount = $info['mount'] ?? '/'; $host = $info['hostname'] ?? 'PBX'; $fmtBytes = function ($bytes) { $bytes = (float) $bytes; $units = ['B', 'KB', 'MB', 'GB', 'TB']; $i = 0; while ($bytes >= 1024 && $i < count($units) - 1) { $bytes /= 1024; $i++; } return round($bytes, $bytes >= 100 || $i <= 1 ? 0 : 1) . ' ' . $units[$i]; }; $totalFmt = $fmtBytes($info['total'] ?? 0); $usedFmt = $fmtBytes($info['used'] ?? 0); $freeFmt = $fmtBytes($info['free'] ?? 0); $accent = $isCritical ? '#dc2626' : '#f59e0b'; $barPct = max(0, min(100, $pct)); @endphp @extends('emails.layouts.base', [ 'subject' => '[' . ($isCritical ? 'CRITICAL' : 'Warning') . '] Disk ' . $pct . '% full — ' . $host, 'title' => $isCritical ? 'Critical: Disk Almost Full' : 'Warning: Disk Space Low', 'subtitle' => $host . ' storage is at ' . $pct . '% capacity.', 'icon' => '💾', 'iconColor' => $accent, ]) @section('content')
{{ $isCritical ? 'Immediate action required' : 'Action recommended' }}
{{-- Usage bar --}}
 
{{ $pct }}% used
Server {{ $host }}
Mount point {{ $mount }}
Total capacity {{ $totalFmt }}
Used {{ $usedFmt }} ({{ $pct }}%)
Free {{ $freeFmt }}
What to check
• Old call recordings and voicemail in storage
• System backups under the backups folder
• Asterisk and application log files
• Consider increasing the disk size if usage keeps growing

This alert is sent once each time disk usage crosses a new threshold (80%, 85%, 90%, 95%). You will not be alerted again at the same level unless usage drops and rises again.

@endsection