Send test emails to webmaster only during startup
All checks were successful
Deploy Production Email Reports (Unified) / deploy (push) Successful in 57s

This commit is contained in:
Frank John Begornia
2026-01-02 02:07:52 +08:00
parent 1c19c86205
commit 2eeec4377f
2 changed files with 12 additions and 6 deletions

View File

@@ -129,10 +129,16 @@ if($result > 0){
$mail->Password = $cfg['smtp_pass'];
$mail->SetFrom($cfg['email_from'], $cfg['email_from_name']);
$mail->addAddress($cfg['email_to']);
foreach ($cfg['email_bcc'] as $bcc) {
$mail->addBCC($bcc);
// Check if this is a test email (override recipients)
$test_mode = getenv('TEST_EMAIL') === 'true';
if ($test_mode) {
$mail->addAddress('webmaster@crewsportswear.com');
} else {
$mail->addAddress($cfg['email_to']);
foreach ($cfg['email_bcc'] as $bcc) {
$mail->addBCC($bcc);
}
}
$mail->addAttachment($filename);