.pa-email-notices{margin:16px 8px;border-top:1px solid #74777c;padding-top:12px;}' .'.pa-email-notices summary{cursor:pointer;font-size:16px;font-weight:600;overflow-wrap:anywhere;}' .'.pa-email-notices table{width:100%;table-layout:fixed;font-size:14px;margin-top:12px;}' .'.pa-email-notices th,.pa-email-notices td{padding:9px 6px;vertical-align:top;overflow-wrap:anywhere;border-bottom:1px solid #666;}' .'.pa-email-notices small{display:block;font-size:12px;line-height:1.5;}' .'.pa-email-ok{color:#b6f08f}.pa-email-failed{color:#ff9cbd}.pa-email-pending{color:#ffe49b}'; } echo '
' .'Email notices ('.count($rows).') - latest: '.$escape($rows[0]['statusLabel']).''; echo ''; foreach ($rows as $row) { $class = $row['stage'] === 'delivered' ? 'pa-email-ok' : (in_array($row['stage'],['hard_bounced','soft_bounced','rejected','failed','blocked'],true) ? 'pa-email-failed' : 'pa-email-pending'); echo '' .''; } echo '
RecipientEmail ResultTime (UTC)
'.$escape($row['recipientRole']).''.$escape($row['recipientName']).'' .$escape($row['destination'] ?: 'No destination recorded'); if (strtolower($row['intendedDestination']) !== strtolower($row['destination'])) { echo 'Intended: '.$escape($row['intendedDestination']).''; } echo ''.$escape($row['statusLabel']).''; if ($row['failureReason']) echo ''.$escape($row['failureReason']).''; if (!empty($row['emailOpenDetected'])) { echo 'Email open detected - not proof of reading'; } echo ''.$escape($row['subject'] ?: $row['template']).'Attempt: '.$escape($row['sentAtUTC']); if ($row['providerEventAtUTC']) echo 'Provider event: '.$escape($row['providerEventAtUTC']).''; if (!empty($row['emailOpenDetected'])) { echo 'First open detected: '.$escape($row['firstEmailOpenAtUTC']).''; if ($row['lastEmailOpenAtUTC'] !== $row['firstEmailOpenAtUTC']) { echo 'Latest open detected: '.$escape($row['lastEmailOpenAtUTC']).''; } echo 'Detected open events: '.(int)$row['emailOpenEventCount'].''; } echo '
'; }