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
@@ -246,6 +246,7 @@ foreach (($activeExceptions ?? []) as $exceptionRow) {
}
}
$emailExampleCount = count($emailExamples ?? []);
$failedEmailCount = count(array_filter($emailExamples ?? [], static fn ($example): bool => ($example['delivery_status'] ?? '') === 'failed'));
$launchReady = empty($launchState['missing']);
$launchApproved = !empty($launchState['approved']);
$defaultTab = 'work';
@@ -726,7 +727,15 @@ $reasonCodes = is_array($exceptionReasonCodes ?? null) ? $exceptionReasonCodes :
<input class="form-check-input" type="checkbox" id="force_resend" name="force_resend" value="1">
<label class="form-check-label small" for="force_resend">Also resend emails already sent</label>
</div>
<button type="submit" class="btn btn-danger" <?= !$launchApproved || !$launchReady || $emailExampleCount === 0 ? 'disabled' : '' ?>>Send real emails</button>
<div class="d-flex flex-wrap gap-2">
<button type="submit" class="btn btn-danger" <?= !$launchApproved || !$launchReady || $emailExampleCount === 0 ? 'disabled' : '' ?>>Send real emails</button>
</div>
</form>
<form class="mt-2" method="post" action="<?= site_url('administrator/enrollment-admin/send-registration-emails') ?>" onsubmit="return confirm('Retry only failed registration emails for <?= esc((string) ($schoolYear ?? ''), 'js') ?>?');">
<?= csrf_field() ?>
<input type="hidden" name="school_year" value="<?= esc($schoolYear ?? '') ?>">
<input type="hidden" name="failed_only" value="1">
<button type="submit" class="btn btn-outline-danger" <?= !$launchApproved || !$launchReady || $failedEmailCount === 0 ? 'disabled' : '' ?>>Send failed emails only<?= $failedEmailCount > 0 ? ' (' . (int) $failedEmailCount . ')' : '' ?></button>
</form>
</div>
</div>