mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
feat: email retry page on 550 rejection; confirmation_email optional in admin form
This commit is contained in:
@@ -325,14 +325,13 @@ class ThesisCreateController
|
||||
}
|
||||
}
|
||||
|
||||
// Confirmation e-mail (required)
|
||||
// Confirmation e-mail (optional)
|
||||
$confirmationEmail = trim($post['confirmation_email'] ?? '');
|
||||
if ($confirmationEmail === '') {
|
||||
throw new Exception("L'adresse e-mail de confirmation est requise.");
|
||||
}
|
||||
$confirmationEmail = filter_var($confirmationEmail, FILTER_VALIDATE_EMAIL);
|
||||
if ($confirmationEmail === false) {
|
||||
throw new Exception("L'adresse e-mail de confirmation n'est pas valide.");
|
||||
if ($confirmationEmail !== '') {
|
||||
$confirmationEmail = filter_var($confirmationEmail, FILTER_VALIDATE_EMAIL);
|
||||
if ($confirmationEmail === false) {
|
||||
throw new Exception("L'adresse e-mail de confirmation n'est pas valide.");
|
||||
}
|
||||
}
|
||||
|
||||
return compact(
|
||||
|
||||
@@ -122,6 +122,13 @@ class Dispatcher {
|
||||
};
|
||||
}
|
||||
|
||||
// /partage/retry-email (GET: show retry form, POST: resend)
|
||||
if ($path === '/partage/retry-email') {
|
||||
return function() {
|
||||
require APP_ROOT . '/public/partage/retry-email.php';
|
||||
};
|
||||
}
|
||||
|
||||
// /partage/*
|
||||
if (preg_match('#^/partage(/.*)?$#', $path)) {
|
||||
return function() {
|
||||
|
||||
@@ -102,9 +102,8 @@ class StudentEmail {
|
||||
try {
|
||||
$result = SmtpRelay::send($db, $to, $subject, $htmlBody);
|
||||
} catch (SmtpSendException $e) {
|
||||
// Confirmation email failure must not abort the successful submission.
|
||||
error_log("[StudentEmail] SMTP error sending to {$to} for thesis #{$thesisId}: " . $e->getMessage());
|
||||
return false;
|
||||
throw $e; // re-throw so callers can react (e.g. redirect to retry page)
|
||||
}
|
||||
|
||||
if ($result) {
|
||||
|
||||
Reference in New Issue
Block a user