<?php if (!defined('DASHBOARD_ROOT')) { http_response_code(403); exit; } RBAC::enforce('view.emails'); ?> <link rel="stylesheet" href="assets/css/emails.css?v=5" nonce="<?= $cspNonce ?? '' ?>"> <div class="workspace" id="ws-emails"> <div style="display: flex; justify-content: flex-end; gap: 12px; margin-bottom: 24px;"> <button class="btn-ghost" data-email-action="refresh"> <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M23 4v6h-6"/><path d="M1 20v-6h6"/><path d="M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15"/></svg> Refresh</button> <button class="btn-primary" data-email-action="test-modal"> <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/><path d="M22 6l-10 7L2 6"/></svg> Test Send</button> </div> <?php require_once __DIR__ . '/../modules/emails/health_grid.php'; ?> <div class="sub-tabs" id="emails-subtabs"> <button class="sub-tab active" data-panel="log">Delivery Log</button> <button class="sub-tab" data-panel="etransfer">e-Transfer Watch</button> </div> <div id="emails-panel-log" class="emails-panel"><?php require_once __DIR__ . '/../modules/emails/delivery_log.php'; ?></div> <div id="emails-panel-etransfer" class="emails-panel" style="display:none"><?php require_once __DIR__ . '/../modules/emails/etransfer_watch.php'; ?></div> <?php require_once __DIR__ . '/../modules/emails/test_modal.php'; ?> </div> <script nonce="<?= $cspNonce ?? '' ?>"> (function(){ var tabs=document.querySelectorAll('#emails-subtabs .sub-tab'); tabs.forEach(function(btn){ btn.addEventListener('click',function(){ tabs.forEach(function(b){b.classList.remove('active');}); btn.classList.add('active'); document.querySelectorAll('.emails-panel').forEach(function(p){p.style.display='none';}); var panel=document.getElementById('emails-panel-'+btn.dataset.panel); if(panel)panel.style.display=''; }); }); })(); </script> <script src="assets/js/emails.js?v=5" nonce="<?= $cspNonce ?? '' ?>"></script>