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:
LarsandClaude Opus 5.5 committed 2026-10-30 10:11:15 +01:00
1 parent 70a39315e2
commit 1c757f7429
20 files changed
+842 -22

No files matched your search

+10 -6
View File
@@ -14,7 +14,8 @@
/**
* Reports possible double bookings found while importing portal occupations (calendar sync or portal
* e-mail). Every conflict lands in the admin inbox once; only conflicts not reported before are e-mailed,
* so a lasting overlap does not trigger a mail on every sync.
* so a lasting overlap does not trigger a mail on every sync. Unread ones are repeated after the landlord's
* reminder interval while the overlap persists (App\Support\Inbox).
*/
class ReportChannelConflicts
{
@@ -22,11 +23,12 @@ public function __construct(private Inbox $inbox) {}
/**
* @param array<string, CarbonInterface> $conflicts description => first night of the portal occupation
* @return list<string> the conflicts reported for the first time
* @return list<string> the conflicts e-mailed now (new ones and due reminders)
*/
public function handle(Channel $channel, array $conflicts): array
{
$new = [];
$reminders = [];
foreach ($conflicts as $description => $startsOn) {
$message = $this->inbox->post(
InboxMessageKind::ChannelConflict,
@@ -36,15 +38,17 @@ public function handle(Channel $channel, array $conflicts): array
$channel,
OccupancyCalendar::getUrl(['monat' => $startsOn->format('Y-m'), 'wohnung' => $channel->property_id]),
);
if ($message) {
if ($message?->wasRecentlyCreated) {
$new[] = $description;
} elseif ($message) {
$reminders[] = $description;
}
}
if ($new !== []) {
rescue(fn () => Mail::to(Settings::notificationRecipients())->send(new ChannelConflict($channel, $new)));
if ($new !== [] || $reminders !== []) {
rescue(fn () => Mail::to(Settings::notificationRecipients())->send(new ChannelConflict($channel, $new, $reminders)));
}
return $new;
return [...$new, ...$reminders];
}
}