fix enrollment and registration email send
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user