extend('layout/email_layout') ?> section('email_content') ?> trim((string)($st['name'] ?? '')), 'studentId' => trim((string)($st['studentId'] ?? '')), 'gradeLevel' => trim((string)($st['gradeLevel'] ?? '')), 'teacherName' => trim((string)($st['teacherName'] ?? '')), 'startDate' => trim((string)($st['startDate'] ?? '')), ]; } // Remove empties by name $studentsArr = array_values(array_filter($studentsArr, fn($r) => $r['name'] !== '')); } // If $studentName is given, it can be string or array // Use it only when we don't have a useful $students array $singleFromNameField = null; if (empty($studentsArr)) { if (is_array($studentName ?? null)) { $singleFromNameField = trim((string)($studentName[0] ?? '')); } else { $singleFromNameField = trim((string)($studentName ?? '')); } } // If students array has exactly one entry, treat as single $isMulti = count($studentsArr) > 1; // Date formatter $fmtDate = function ($d) { if (!$d) return null; $ts = strtotime($d); if ($ts) { try { $dt = (new DateTime('@' . $ts)); // UTC epoch-based return local_date($dt, 'm-d-Y'); } catch (Throwable $e) { // fall back to raw string if conversion fails } } return $d; }; // Build single-student detail fallbacks (from controller or first student) $singleDetails = [ 'name' => $singleFromNameField ?: trim((string)($studentsArr[0]['name'] ?? '')), 'studentId' => trim((string)($studentId ?? ($studentsArr[0]['studentId'] ?? ''))), 'gradeLevel' => trim((string)($gradeLevel ?? ($studentsArr[0]['gradeLevel'] ?? ''))), 'teacherName' => trim((string)($teacherName ?? ($studentsArr[0]['teacherName'] ?? ''))), 'startDate' => trim((string)($startDate ?? ($studentsArr[0]['startDate'] ?? ''))), ]; ?>

Enrollment Confirmed

Dear ,

We are pleased to inform you that the following students are now officially enrolled for the school year:

We are pleased to inform you that is now officially enrolled for the school year.

Access My Account

Welcome to our school community!

Best regards,
Admissions Team

endSection() ?>