- Connector-System (app/Channels, config/channels.php) mit iCal-Connector, robustem Parser und Export-Feed je Portal (ohne eigene Belegungen, ohne Gästedaten) - Abgleich alle 5 Min. mit Protokoll, Echo-Erkennung, Konflikt-Mail bei möglicher Doppelbuchung - Überwachung: Störungs-Mail, Status-Endpunkt /health/sync für n8n - Portal-Aufgaben für Sofortbuchungsportale (FeWo-direkt): automatisch aus Buchungen/Sperren/anderen Portalen, Mail + Erinnerung, Abhaken im Admin - Optionaler signierter Automatisierungs-Webhook mit Rückmeldung - Herkunftsmessung: Abfrage im Formular + UTM-Parameter - Portal-Analyse: AGB-Prüfung Automatisierung, Umsetzungsbeschreibung Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
33 lines
881 B
PHP
33 lines
881 B
PHP
<?php
|
|
|
|
namespace App\Actions;
|
|
|
|
use App\Mail\ChannelTasksNotification;
|
|
use App\Models\ChannelTask;
|
|
use Illuminate\Support\Facades\Mail;
|
|
|
|
/**
|
|
* Reminds the landlord once about blocking tasks that are still open after the reminder time.
|
|
*/
|
|
class RemindChannelTasks
|
|
{
|
|
public function handle(): int
|
|
{
|
|
$tasks = ChannelTask::query()
|
|
->open()
|
|
->whereNull('reminded_at')
|
|
->where('created_at', '<=', now()->subMinutes(config('fewo.channels.task_reminder_after_minutes')))
|
|
->with('channel')
|
|
->get();
|
|
|
|
if ($tasks->isEmpty()) {
|
|
return 0;
|
|
}
|
|
|
|
Mail::to(config('fewo.notification_email'))->send(new ChannelTasksNotification($tasks->all(), reminder: true));
|
|
ChannelTask::whereKey($tasks->modelKeys())->update(['reminded_at' => now()]);
|
|
|
|
return $tasks->count();
|
|
}
|
|
}
|