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 ""
|
||||||
|
|
||||||
echo "[Testing Crew Sportswear]"
|
echo "[Testing Crew Sportswear]"
|
||||||
BRAND=crew php /app/send_report.php
|
TEST_EMAIL=true BRAND=crew php /app/send_report.php
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
echo "[Testing MerchBay]"
|
echo "[Testing MerchBay]"
|
||||||
BRAND=merchbay php /app/send_report.php
|
TEST_EMAIL=true BRAND=merchbay php /app/send_report.php
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
echo "✓ Test emails sent. Check graphics@crewsportswear.com inbox."
|
echo "✓ Test emails sent to webmaster@crewsportswear.com"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Container is ready. Tailing logs..."
|
echo "Container is ready. Tailing logs..."
|
||||||
echo "Press Ctrl+C to stop (but don't - this keeps the container alive!)"
|
echo "Press Ctrl+C to stop (but don't - this keeps the container alive!)"
|
||||||
|
|||||||
@@ -129,11 +129,17 @@ if($result > 0){
|
|||||||
$mail->Password = $cfg['smtp_pass'];
|
$mail->Password = $cfg['smtp_pass'];
|
||||||
|
|
||||||
$mail->SetFrom($cfg['email_from'], $cfg['email_from_name']);
|
$mail->SetFrom($cfg['email_from'], $cfg['email_from_name']);
|
||||||
$mail->addAddress($cfg['email_to']);
|
|
||||||
|
|
||||||
|
// 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) {
|
foreach ($cfg['email_bcc'] as $bcc) {
|
||||||
$mail->addBCC($bcc);
|
$mail->addBCC($bcc);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$mail->addAttachment($filename);
|
$mail->addAttachment($filename);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user