Send test emails to webmaster only during startup
All checks were successful
Deploy Production Email Reports (Unified) / deploy (push) Successful in 57s
All checks were successful
Deploy Production Email Reports (Unified) / deploy (push) Successful in 57s
This commit is contained in:
@@ -73,14 +73,14 @@ echo "Sending test emails to verify configuration..."
|
||||
echo ""
|
||||
|
||||
echo "[Testing Crew Sportswear]"
|
||||
BRAND=crew php /app/send_report.php
|
||||
TEST_EMAIL=true BRAND=crew php /app/send_report.php
|
||||
echo ""
|
||||
|
||||
echo "[Testing MerchBay]"
|
||||
BRAND=merchbay php /app/send_report.php
|
||||
TEST_EMAIL=true BRAND=merchbay php /app/send_report.php
|
||||
echo ""
|
||||
|
||||
echo "✓ Test emails sent. Check graphics@crewsportswear.com inbox."
|
||||
echo "✓ Test emails sent to webmaster@crewsportswear.com"
|
||||
echo ""
|
||||
echo "Container is ready. Tailing logs..."
|
||||
echo "Press Ctrl+C to stop (but don't - this keeps the container alive!)"
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user