only send digests when trip in progress
This commit is contained in:
parent
d5d0b426f1
commit
0d660ca22f
1 changed files with 25 additions and 21 deletions
|
@ -41,8 +41,9 @@ class SendDigest extends Command
|
|||
|
||||
$test_address = $this->option('test') ? [config('app.test_address')] : null;
|
||||
|
||||
if (config('app.current_trip_id')) {
|
||||
// These are seperated because I may want to send multiple types
|
||||
// of digest in a single commend.
|
||||
// of digest in a single command.
|
||||
if ($this->option('daily')) {
|
||||
foreach (($test_address ?? config('app.daily_digest_recipients')) as $recipient) {
|
||||
Log::debug("Daily digest email sent to '{$recipient}'.");
|
||||
|
@ -70,5 +71,8 @@ class SendDigest extends Command
|
|||
Mail::to($recipient)->send(new Digest('monthly', config('app.current_trip_id')));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log::debug("No trip currently running, no digests sent.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue