fix enrollment and registration email send
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 49s
Tests / PHPUnit (push) Failing after 1m20s

This commit is contained in:
root
2026-08-28 16:16:59 -04:00
parent 3133b3c584
commit d2cb159451
6 changed files with 118 additions and 73 deletions
@@ -95,10 +95,13 @@ class EnrollmentAdminController extends BaseController
return redirect()->back()->with('error', 'Registration launch is not ready: ' . implode(', ', $missing));
}
$force = (bool) $this->request->getPost('force_resend');
$result = service('enrollmentRegistrationEmail')->sendForSchoolYearName($schoolYear, $force);
$failedOnly = (bool) $this->request->getPost('failed_only');
$force = ! $failedOnly && (bool) $this->request->getPost('force_resend');
$result = service('enrollmentRegistrationEmail')->sendForSchoolYearName($schoolYear, $force, $failedOnly);
$message = sprintf(
'Registration emails processed for %s: %d sent, %d failed, %d skipped.',
$failedOnly
? 'Failed registration emails retried for %s: %d sent, %d failed, %d skipped.'
: 'Registration emails processed for %s: %d sent, %d failed, %d skipped.',
$schoolYear,
(int) ($result['sent'] ?? 0),
(int) ($result['failed'] ?? 0),