diff --git a/app/Console/Commands/SendDigest.php b/app/Console/Commands/SendDigest.php index c0311ab..056b4cf 100644 --- a/app/Console/Commands/SendDigest.php +++ b/app/Console/Commands/SendDigest.php @@ -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'))); }