Fix email test addressing

This commit is contained in:
Ben Goldsworthy 2022-12-04 18:06:14 +00:00
parent 159f8e98d4
commit e7671ccded

View file

@ -51,21 +51,21 @@ class SendDigest extends Command
}
if ($this->option('weekly')) {
foreach (config('app.weekly_digest_recipients') as $recipient) {
foreach (($test_address ?? config('app.weekly_digest_recipients')) as $recipient) {
Log::debug("Weekly digest email sent to '{$recipient}'.");
Mail::to($recipient)->send(new Digest('weekly', config('app.current_trip_id')));
}
}
if ($this->option('fortnightly')) {
foreach (config('app.fortnightly_digest_recipients') as $recipient) {
foreach (($test_address ?? config('app.fortnightly_digest_recipients')) as $recipient) {
Log::debug("Fortnightly digest email sent to '{$recipient}'.");
Mail::to($recipient)->send(new Digest('fortnightly', config('app.current_trip_id')));
}
}
if ($this->option('monthly')) {
foreach (config('app.monthly_digest_recipients') as $recipient) {
foreach (($test_address ?? config('app.monthly_digest_recipients')) as $recipient) {
Log::debug("Monthly digest email sent to '{$recipient}'.");
Mail::to($recipient)->send(new Digest('monthly', config('app.current_trip_id')));
}