Erinnerungsabstand und taegliche/woechentliche Zusammenfassung einstellbar
System > Betrieb > Benachrichtigungen: offene Meldungen (Doppelbuchungen im Postfach, Portal-Aufgaben) nur einmal oder alle 1/2/3/7 Tage erneut senden; Tages- und/oder Wochenuebersicht mit waehlbarer Uhrzeit, Wochentag und Inhalt (Postfach, Anfragen, Neues, An-/Abreisen, Zahlungen, Portale, Bewertungen). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
70a39315e2
commit
1c757f7429
20 files changed
+842
-22
No files matched your search
@@ -5,18 +5,24 @@
|
||||
use App\Mail\ChannelTasksNotification;
|
||||
use App\Models\ChannelTask;
|
||||
use App\Support\Settings;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
/**
|
||||
* Reminds the landlord once about blocking tasks that are still open after the reminder time.
|
||||
* Reminds the landlord about blocking tasks that are still open after the reminder time, and again after
|
||||
* the landlord's reminder interval while they stay open (Settings::reminderIntervalDays(), 0 = only once).
|
||||
*/
|
||||
class RemindChannelTasks
|
||||
{
|
||||
public function handle(): int
|
||||
{
|
||||
$interval = Settings::reminderIntervalDays();
|
||||
|
||||
$tasks = ChannelTask::query()
|
||||
->open()
|
||||
->whereNull('reminded_at')
|
||||
->where(fn (Builder $query) => $query
|
||||
->whereNull('reminded_at')
|
||||
->when($interval > 0, fn (Builder $query) => $query->orWhere('reminded_at', '<=', now()->subDays($interval))))
|
||||
->where('created_at', '<=', now()->subMinutes(config('fewo.channels.task_reminder_after_minutes')))
|
||||
->with('channel')
|
||||
->get();
|
||||
|
||||
Reference in new issue
Block a user