Addresses of the internal communication in the admin (notification recipients, contact/reply-to, sender)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lars StommerandClaude Opus 5.5 committed 2026-10-23 07:14:25 +02:00
1 parent 749537342e
commit 323f4f9174
20 files changed
+165 -20

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@ # Ferienwohnung Stommer
- Website = theme system (`docs/THEMES.md`): themes live in `resources/themes/<key>` (theme.json, theme.css, theme.js, views); views resolve via the `theme::` namespace (theme → parent → base `ostsee-licht`). Pages are lists of sections (`app/Themes/Sections`, catalogue in `config/themes.php`); seasonal `Appearance`s override tokens/texts/hero photo/photos per section (stable `data.id` per placed section) and sections can be limited to appearances. Theme views use only token colour classes (`bg-accent`, `text-muted`, …). New designs are **additional** themes: `php artisan themes:make <key>`, `themes:check`, `themes:preview` – never edit `ostsee-licht` for a new design; authoring rules in `docs/THEME-ERSTELLUNG.md`. Resolve `Theme` lazily (`app(Theme::class)`), never in constructors – middleware `ResolveTheme` replaces it per request.
- Operations (environments, Strato access, server .env, admin accounts, 2FA, known pitfalls): `docs/BETRIEB.md` – read it before touching a server. Admin accounts: `php artisan users:create`; 2FA (Filament app authentication) is mandatory for every account. Admin modes (`App\Enums\AdminMode`: simple/expert per user, user menu switch) only shape the menu via the `FollowsAdminMode` trait on every resource/page (simple menu = `AdminMode::SIMPLE_NAVIGATION`); permissions stay with roles/policies. New admin resources must use `FollowsAdminMode`.
- Deployment: `scripts/deploy.sh <env> setup|deploy [ref]|rollback|releases|artisan` (atomic releases on Strato, docs/DEPLOYMENT.md; the server keeps only the active release because of Strato's file quota – history = Git tags `deploy/<env>/<timestamp>`); CI `.gitea/workflows/deploy.yml`. Production has no dev packages (no factories/Faker) – production seeding via `ProductionSeeder`.
- Strato specifics: `public/index.php` strips the internal `/releases/<v>/public` prefix from `REQUEST_URI` (signed URLs); `URL::forceRootUrl(APP_URL)` outside local/testing; mail routing: `App\Support\Settings` (admin page System › Betrieb) – test mode (default) sends every mail to the test recipient only, live delivers normally; `FEWO_MAIL_REDIRECT_TO` is a hard override. The booking form is protected against bots (`config('fewo.spam')`: honeypot, time trap, rate limits, max open holds per e-mail) – tests that submit it instantly set `fewo.spam.min_seconds` to 0.
- Strato specifics: `public/index.php` strips the internal `/releases/<v>/public` prefix from `REQUEST_URI` (signed URLs); `URL::forceRootUrl(APP_URL)` outside local/testing; mail routing: `App\Support\Settings` (admin page System › Betrieb) – test mode (default) sends every mail to the test recipient only, live delivers normally; `FEWO_MAIL_REDIRECT_TO` is a hard override. Internal addresses are admin settings too: send notifications to `Settings::notificationRecipients()` (never `config('fewo.notification_email')` directly); contact/reply-to (`fewo.owner.email`) and sender (`mail.from`) are overridden at boot by `Settings::applyAddressOverrides()`. The booking form is protected against bots (`config('fewo.spam')`: honeypot, time trap, rate limits, max open holds per e-mail) – tests that submit it instantly set `fewo.spam.min_seconds` to 0.
- Vite fonts plugin is removed on purpose (corporate proxy breaks remote font downloads, and fonts must be self-hosted for GDPR).
- PHP/Composer on this machine: winget package dir `%LOCALAPPDATA%\Microsoft\WinGet\Packages\PHP.PHP.8.4_*` (Composer as `composer\composer.phar` there).
- Git remote: Gitea `https://gitea.stommer.de/Lars/fewo-stommer.git`, branch `main`.
+1 -1
View File
@@ -17,7 +17,7 @@ # Ferienwohnung Stommer
- Website = theme system (`docs/THEMES.md`): themes live in `resources/themes/<key>` (theme.json, theme.css, theme.js, views); views resolve via the `theme::` namespace (theme → parent → base `ostsee-licht`). Pages are lists of sections (`app/Themes/Sections`, catalogue in `config/themes.php`); seasonal `Appearance`s override tokens/texts/hero photo/photos per section (stable `data.id` per placed section) and sections can be limited to appearances. Theme views use only token colour classes (`bg-accent`, `text-muted`, …). New designs are **additional** themes: `php artisan themes:make <key>`, `themes:check`, `themes:preview` – never edit `ostsee-licht` for a new design; authoring rules in `docs/THEME-ERSTELLUNG.md`. Resolve `Theme` lazily (`app(Theme::class)`), never in constructors – middleware `ResolveTheme` replaces it per request.
- Operations (environments, Strato access, server .env, admin accounts, 2FA, known pitfalls): `docs/BETRIEB.md` – read it before touching a server. Admin accounts: `php artisan users:create`; 2FA (Filament app authentication) is mandatory for every account. Admin modes (`App\Enums\AdminMode`: simple/expert per user, user menu switch) only shape the menu via the `FollowsAdminMode` trait on every resource/page (simple menu = `AdminMode::SIMPLE_NAVIGATION`); permissions stay with roles/policies. New admin resources must use `FollowsAdminMode`.
- Deployment: `scripts/deploy.sh <env> setup|deploy [ref]|rollback|releases|artisan` (atomic releases on Strato, docs/DEPLOYMENT.md; the server keeps only the active release because of Strato's file quota – history = Git tags `deploy/<env>/<timestamp>`); CI `.gitea/workflows/deploy.yml`. Production has no dev packages (no factories/Faker) – production seeding via `ProductionSeeder`.
- Strato specifics: `public/index.php` strips the internal `/releases/<v>/public` prefix from `REQUEST_URI` (signed URLs); `URL::forceRootUrl(APP_URL)` outside local/testing; mail routing: `App\Support\Settings` (admin page System › Betrieb) – test mode (default) sends every mail to the test recipient only, live delivers normally; `FEWO_MAIL_REDIRECT_TO` is a hard override. The booking form is protected against bots (`config('fewo.spam')`: honeypot, time trap, rate limits, max open holds per e-mail) – tests that submit it instantly set `fewo.spam.min_seconds` to 0.
- Strato specifics: `public/index.php` strips the internal `/releases/<v>/public` prefix from `REQUEST_URI` (signed URLs); `URL::forceRootUrl(APP_URL)` outside local/testing; mail routing: `App\Support\Settings` (admin page System › Betrieb) – test mode (default) sends every mail to the test recipient only, live delivers normally; `FEWO_MAIL_REDIRECT_TO` is a hard override. Internal addresses are admin settings too: send notifications to `Settings::notificationRecipients()` (never `config('fewo.notification_email')` directly); contact/reply-to (`fewo.owner.email`) and sender (`mail.from`) are overridden at boot by `Settings::applyAddressOverrides()`. The booking form is protected against bots (`config('fewo.spam')`: honeypot, time trap, rate limits, max open holds per e-mail) – tests that submit it instantly set `fewo.spam.min_seconds` to 0.
- Vite fonts plugin is removed on purpose (corporate proxy breaks remote font downloads, and fonts must be self-hosted for GDPR).
- PHP/Composer on this machine: winget package dir `%LOCALAPPDATA%\Microsoft\WinGet\Packages\PHP.PHP.8.4_*` (Composer as `composer\composer.phar` there).
- Git remote: Gitea `https://gitea.stommer.de/Lars/fewo-stommer.git`, branch `main`.
+2 -1
View File
@@ -7,6 +7,7 @@
use App\Mail\OfferAnswered;
use App\Models\Booking;
use App\Support\Content;
use App\Support\Settings;
use Illuminate\Support\Facades\Mail;
use Throwable;
@@ -41,7 +42,7 @@ public function handle(Booking $booking, int $offerVersion): void
$this->confirm->handle($booking);
try {
Mail::to(config('fewo.notification_email'))->send(new OfferAnswered($booking, accepted: true));
Mail::to(Settings::notificationRecipients())->send(new OfferAnswered($booking, accepted: true));
} catch (Throwable $exception) {
report($exception);
}
+2 -1
View File
@@ -7,6 +7,7 @@
use App\Models\Channel;
use App\Models\ChannelTask;
use App\Models\Property;
use App\Support\Settings;
use Carbon\CarbonInterface;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Mail;
@@ -45,7 +46,7 @@ public function handle(Property $property, CarbonInterface $startsOn, CarbonInte
return [];
}
rescue(fn () => Mail::to(config('fewo.notification_email'))->send(new ChannelTasksNotification($tasks)));
rescue(fn () => Mail::to(Settings::notificationRecipients())->send(new ChannelTasksNotification($tasks)));
foreach ($tasks as $task) {
$this->sendToAutomation($task);
+2 -1
View File
@@ -13,6 +13,7 @@
use App\Pricing\PriceCalculator;
use App\Pricing\QuoteException;
use App\Pricing\StayRequest;
use App\Support\Settings;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Mail;
@@ -119,7 +120,7 @@ private function sendMails(Booking $booking): void
{
try {
Mail::to($booking->guest->email, $booking->guest->full_name)->send(new ReservationReceived($booking));
Mail::to(config('fewo.notification_email'))->send(new NewReservation($booking));
Mail::to(Settings::notificationRecipients())->send(new NewReservation($booking));
} catch (Throwable $exception) {
report($exception);
}
+2 -1
View File
@@ -5,6 +5,7 @@
use App\Enums\BookingStatus;
use App\Mail\ReservationExpired;
use App\Models\Booking;
use App\Support\Settings;
use Illuminate\Support\Facades\Mail;
/**
@@ -24,7 +25,7 @@ public function handle(): int
foreach ($expired as $booking) {
$booking->update(['status' => BookingStatus::Expired]);
Mail::to(config('fewo.notification_email'))->send(new ReservationExpired($booking));
Mail::to(Settings::notificationRecipients())->send(new ReservationExpired($booking));
}
return $expired->count();
+3 -2
View File
@@ -6,6 +6,7 @@
use App\Mail\ChannelSyncAlert;
use App\Mail\MailboxAlert;
use App\Models\Channel;
use App\Support\Settings;
use Carbon\CarbonImmutable;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Mail;
@@ -24,7 +25,7 @@ public function handle(): int
->filter(fn (Channel $channel): bool => $channel->isStale());
foreach ($channels as $channel) {
Mail::to(config('fewo.notification_email'))->send(new ChannelSyncAlert($channel));
Mail::to(Settings::notificationRecipients())->send(new ChannelSyncAlert($channel));
$channel->forceFill(['alerted_at' => now()])->save();
}
@@ -55,7 +56,7 @@ private function monitorMailbox(): int
return 0;
}
Mail::to(config('fewo.notification_email'))->send(new MailboxAlert(Cache::get(MailboxReader::LAST_ERROR_KEY)));
Mail::to(Settings::notificationRecipients())->send(new MailboxAlert(Cache::get(MailboxReader::LAST_ERROR_KEY)));
Cache::forever(self::MAILBOX_ALERTED_KEY, true);
return 1;
+3 -2
View File
@@ -13,6 +13,7 @@
use App\Models\BlockedPeriod;
use App\Models\Channel;
use App\Models\PortalEmail;
use App\Support\Settings;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Mail;
@@ -68,11 +69,11 @@ public function handle(PortalMail $mail): ?PortalEmail
});
if (in_array($record->status, [PortalEmailStatus::Blocked, PortalEmailStatus::Released, PortalEmailStatus::NeedsReview], true)) {
rescue(fn () => Mail::to(config('fewo.notification_email'))->send(new PortalMailNotification($record)));
rescue(fn () => Mail::to(Settings::notificationRecipients())->send(new PortalMailNotification($record)));
}
if ($conflicts !== []) {
rescue(fn () => Mail::to(config('fewo.notification_email'))->send(new ChannelConflict($channel, $conflicts)));
rescue(fn () => Mail::to(Settings::notificationRecipients())->send(new ChannelConflict($channel, $conflicts)));
}
return $record;
+2 -1
View File
@@ -6,6 +6,7 @@
use App\Exceptions\ReservationException;
use App\Mail\OfferAnswered;
use App\Models\Booking;
use App\Support\Settings;
use Illuminate\Support\Facades\Mail;
use Throwable;
@@ -34,7 +35,7 @@ public function handle(Booking $booking, int $offerVersion): void
]);
try {
Mail::to(config('fewo.notification_email'))->send(new OfferAnswered($booking, accepted: false));
Mail::to(Settings::notificationRecipients())->send(new OfferAnswered($booking, accepted: false));
} catch (Throwable $exception) {
report($exception);
}
+2 -1
View File
@@ -4,6 +4,7 @@
use App\Mail\ChannelTasksNotification;
use App\Models\ChannelTask;
use App\Support\Settings;
use Illuminate\Support\Facades\Mail;
/**
@@ -24,7 +25,7 @@ public function handle(): int
return 0;
}
Mail::to(config('fewo.notification_email'))->send(new ChannelTasksNotification($tasks->all(), reminder: true));
Mail::to(Settings::notificationRecipients())->send(new ChannelTasksNotification($tasks->all(), reminder: true));
ChannelTask::whereKey($tasks->modelKeys())->update(['reminded_at' => now()]);
return $tasks->count();
+2 -1
View File
@@ -7,6 +7,7 @@
use App\Mail\NewReview;
use App\Models\Booking;
use App\Models\Review;
use App\Support\Settings;
use Illuminate\Support\Facades\Mail;
use RuntimeException;
@@ -32,7 +33,7 @@ public function handle(Booking $booking, array $data): Review
'stayed_on' => $booking->arrival,
]);
Mail::to(config('fewo.notification_email'))->send(new NewReview($review));
Mail::to(Settings::notificationRecipients())->send(new NewReview($review));
return $review;
}
+2 -1
View File
@@ -9,6 +9,7 @@
use App\Models\BlockedPeriod;
use App\Models\Channel;
use App\Models\ChannelSyncLog;
use App\Support\Settings;
use Carbon\CarbonImmutable;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Mail;
@@ -109,7 +110,7 @@ public function handle(Channel $channel): ChannelSyncLog
])->save();
if ($conflicts !== []) {
rescue(fn () => Mail::to(config('fewo.notification_email'))->send(new ChannelConflict($channel, $conflicts)));
rescue(fn () => Mail::to(Settings::notificationRecipients())->send(new ChannelConflict($channel, $conflicts)));
}
return $channel->syncLogs()->create([
+1 -1
View File
@@ -18,7 +18,7 @@ class SendTestMail extends Command
*/
public function handle(): int
{
$to = (string) ($this->argument('to') ?: config('fewo.notification_email'));
$to = (string) ($this->argument('to') ?: Settings::notificationRecipients()[0] ?? config('fewo.owner.email'));
$mailer = (string) config('mail.default');
$redirect = Settings::mailRedirect();
+41 -2
View File
@@ -8,6 +8,7 @@
use BackedEnum;
use Filament\Actions\Action;
use Filament\Forms\Components\Radio;
use Filament\Forms\Components\TagsInput;
use Filament\Forms\Components\TextInput;
use Filament\Notifications\Notification;
use Filament\Pages\Page;
@@ -22,8 +23,8 @@
use UnitEnum;
/**
* Operating mode: test mode sends every e-mail to one test recipient only; switching live delivers to the
* real recipients (guests, landlord). Administrators only.
* Operating mode (test mode sends every e-mail to one test recipient only; live delivers to the real recipients)
* and the addresses of the internal communication (notifications, contact/reply-to, sender). Administrators only.
*/
class Operations extends Page
{
@@ -54,6 +55,10 @@ public function mount(): void
$this->form->fill([
'mode' => Settings::get(Settings::MODE, Settings::MODE_TEST),
'test_recipient' => Settings::get(Settings::TEST_RECIPIENT) ?? auth()->user()?->email,
'notification_recipients' => Settings::notificationRecipients(),
'contact_email' => config('fewo.owner.email'),
'sender_name' => config('mail.from.name'),
'sender_email' => config('mail.from.address'),
]);
}
@@ -82,6 +87,36 @@ public function form(Schema $schema): Schema
? 'Hinweis: Auf diesem Server ist zusätzlich FEWO_MAIL_REDIRECT_TO='.config('fewo.mail_redirect_to').' gesetzt – diese Umleitung gilt immer, auch wenn hier scharf geschaltet ist.'
: ''),
]),
Section::make('Adressen der internen Kommunikation')
->description('Gelten sofort für alle E-Mails, die Webseite und den Mietvertrag. Im Testbetrieb gehen trotzdem alle E-Mails nur an die Testadresse.')
->columns(2)
->schema([
TagsInput::make('notification_recipients')
->label('Benachrichtigungen an')
->helperText('Neue Anfragen, angenommene/abgelehnte Angebote, abgelaufene Fristen, Bewertungen, Portal-Mails und -Aufgaben, Kopie der Zahlungserinnerungen. Mehrere Adressen möglich (Enter nach jeder Adresse).')
->placeholder('adresse@beispiel.de')
->nestedRecursiveRules(['email'])
->required()
->columnSpanFull(),
TextInput::make('contact_email')
->label('Kontakt- und Antwortadresse')
->helperText('Steht auf der Webseite und im Mietvertrag; Antworten der Gäste auf unsere E-Mails gehen hierhin.')
->email()
->required(),
TextInput::make('sender_name')
->label('Absendername')
->required()
->maxLength(100),
TextInput::make('sender_email')
->label('Absenderadresse')
->helperText(fn (): string => 'Muss das Postfach sein, mit dem der Server versendet (SMTP-Anmeldung: '.(config('mail.mailers.smtp.username') ?: 'nicht gesetzt').') – sonst lehnt Strato den Versand ab.')
->email()
->required(),
Text::make(fn (Get $get): string => filled(config('mail.mailers.smtp.username')) && filled($get('sender_email')) && strcasecmp((string) $get('sender_email'), (string) config('mail.mailers.smtp.username')) !== 0
? '⚠ Die Absenderadresse weicht vom SMTP-Postfach ('.config('mail.mailers.smtp.username').') ab. Strato stellt solche E-Mails in der Regel nicht zu.'
: '')
->columnSpanFull(),
]),
]);
}
@@ -108,6 +143,10 @@ public function save(): void
Settings::save([
Settings::MODE => $data['mode'],
Settings::TEST_RECIPIENT => $data['test_recipient'] ?? Settings::get(Settings::TEST_RECIPIENT),
Settings::NOTIFICATION_RECIPIENTS => implode(', ', Settings::addressList(implode(',', $data['notification_recipients'] ?? []))),
Settings::CONTACT_EMAIL => $data['contact_email'],
Settings::SENDER_NAME => $data['sender_name'],
Settings::SENDER_EMAIL => $data['sender_email'],
]);
}
}
+2 -1
View File
@@ -3,6 +3,7 @@
namespace App\Mail;
use App\Models\Booking;
use App\Support\Settings;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Address;
@@ -33,7 +34,7 @@ public function envelope(): Envelope
default => "Zahlungserinnerung zu Ihrer Buchung {$this->booking->reference}",
},
replyTo: [new Address(config('fewo.owner.email'), config('fewo.owner.name'))],
bcc: $this->kind === self::BALANCE_REQUEST ? [] : [new Address(config('fewo.notification_email'))],
bcc: $this->kind === self::BALANCE_REQUEST ? [] : array_map(fn (string $address): Address => new Address($address), Settings::notificationRecipients()),
);
}
+1
View File
@@ -25,6 +25,7 @@ public function register(): void
public function boot(): void
{
// Test mode (System › Betrieb, default until switched live): every e-mail goes to the test recipient only.
Settings::applyAddressOverrides();
Settings::applyMailRouting();
// Photos: remove metadata (GPS position, camera data) from uploaded originals, which stay downloadable.
+51 -1
View File
@@ -19,6 +19,16 @@ class Settings
public const TEST_RECIPIENT = 'operations.test_recipient';
/** Comma-separated: who is informed about new requests, answered offers, portal events … */
public const NOTIFICATION_RECIPIENTS = 'addresses.notifications';
/** Contact address shown on the website and in the contract; reply-to of guest mails. */
public const CONTACT_EMAIL = 'addresses.contact';
public const SENDER_EMAIL = 'addresses.sender_email';
public const SENDER_NAME = 'addresses.sender_name';
public const MODE_TEST = 'test';
public const MODE_LIVE = 'live';
@@ -46,9 +56,49 @@ public static function save(array $values): void
}
Cache::forget(self::CACHE_KEY);
self::applyAddressOverrides();
self::applyMailRouting();
}
/**
* The recipients of internal notifications (admin setting, else FEWO_NOTIFICATION_EMAIL).
*
* @return list<string>
*/
public static function notificationRecipients(): array
{
return self::addressList(self::get(self::NOTIFICATION_RECIPIENTS) ?: (string) config('fewo.notification_email'));
}
/**
* "a@x.de, b@y.de; c@z.de" → valid addresses only.
*
* @return list<string>
*/
public static function addressList(?string $value): array
{
return array_values(array_filter(
array_map('trim', preg_split('/[,;\s]+/', (string) $value) ?: []),
fn (string $address): bool => filter_var($address, FILTER_VALIDATE_EMAIL) !== false,
));
}
/**
* Admin settings for the contact address and the sender override the .env values for this request.
*/
public static function applyAddressOverrides(): void
{
$overrides = array_filter([
'fewo.owner.email' => self::get(self::CONTACT_EMAIL),
'mail.from.address' => self::get(self::SENDER_EMAIL),
'mail.from.name' => self::get(self::SENDER_NAME),
]);
if ($overrides !== []) {
config($overrides);
}
}
public static function isLive(): bool
{
return self::get(self::MODE, self::MODE_TEST) === self::MODE_LIVE;
@@ -69,7 +119,7 @@ public static function mailRedirect(): ?string
return null;
}
return self::get(self::TEST_RECIPIENT) ?: (config('fewo.notification_email') ?: null);
return self::get(self::TEST_RECIPIENT) ?: (self::notificationRecipients()[0] ?? null);
}
/**
+1
View File
@@ -75,6 +75,7 @@ ## 5. Konfiguration auf dem Server (`shared/.env`)
## 5a. E-Mail: Testbetrieb und scharf schalten
- **Betriebsart** in der Verwaltung: **System › Betrieb** (nur Administratoren). Jede Installation beginnt im **Testbetrieb**: alle E-Mails (an Gäste, Vermieterin, Benachrichtigungen) gehen ausschließlich an die dort eingetragene **Testadresse** (ohne Eintrag: `FEWO_NOTIFICATION_EMAIL`), egal was auf der Webseite eingetragen wurde. Ein gelber Hinweis oben in der Verwaltung zeigt das an. Erst „Scharf geschaltet“ liefert an die echten Empfänger.
- **Adressen der internen Kommunikation** ebenfalls unter System › Betrieb: *Benachrichtigungen an* (mehrere Adressen: neue Anfragen, Angebotsantworten, Fristabläufe, Bewertungen, Portal-Mails/-Aufgaben, Kopie der Zahlungserinnerungen), *Kontakt- und Antwortadresse* (Webseite, Mietvertrag, Antwortadresse der Gäste-Mails), *Absendername/-adresse* (muss zum SMTP-Postfach `MAIL_USERNAME` passen – das Formular warnt). Ohne Eintrag gelten `FEWO_NOTIFICATION_EMAIL`, `FEWO_OWNER_EMAIL`, `MAIL_FROM_*` aus `shared/.env`.
- `FEWO_MAIL_REDIRECT_TO` in `shared/.env` ist eine **harte Überschreibung** für Testserver (gilt auch bei „scharf“); normalerweise leer lassen.
- **Versandweg:** Standard `MAIL_MAILER=log` – dann wird gar nichts zugestellt (auch nicht im Protokoll gespeichert). Für echten Versand in `shared/.env` `MAIL_MAILER=smtp` und `MAIL_PASSWORD=<Passwort des Postfachs info@fewo-stommer.de>` (nur selbst eintragen; Absender und SMTP-Anmeldung: `info@fewo-stommer.de`, Antwortadresse und Benachrichtigungen weiter `FEWO_OWNER_EMAIL`/`FEWO_NOTIFICATION_EMAIL` = fewo@stommer.de), dann `bash scripts/deploy.sh staging artisan optimize`.
- **Versand prüfen:** `bash scripts/deploy.sh staging artisan mail:test` – zeigt Versandweg, Umleitung und Fehler (z. B. SMTP-Anmeldung) und schickt eine Testmail.
+1 -1
View File
@@ -85,7 +85,7 @@ ## 3. Offen
## 4. Nächste Schritte (Vorschlag)
1. Cronjob einrichten; SMTP einschalten und mit `mail:test` prüfen (Mails landen wegen Testbetrieb nur bei Lars); Konto für Brigitte anlegen.
1a. Vor dem Go-Live: System › Betrieb auf „scharf geschaltet“ stellen – erst dann erhalten Gäste die Mails. Beim Go-Live außerdem Kontakt-/Antwortadresse und Benachrichtigungen (`FEWO_OWNER_EMAIL`, `FEWO_NOTIFICATION_EMAIL`) von fewo@stommer.de auf **info@fewo-stommer.de** umstellen (Entscheidung 23.10.2026; Absender ist bereits info@fewo-stommer.de).
1a. Vor dem Go-Live: System › Betrieb auf „scharf geschaltet“ stellen – erst dann erhalten Gäste die Mails. Beim Go-Live außerdem unter System › Betrieb › Adressen Kontakt-/Antwortadresse und Benachrichtigungen von fewo@stommer.de auf **info@fewo-stommer.de** umstellen (Entscheidung 23.10.2026; Absender ist bereits info@fewo-stommer.de).
2. Brigitte probt Anfrage → Angebot → Annahme mit einem eigenen Test (Angebotslink über die Aktion „Angebotslink“).
3. Design-Theme auf dem privaten Rechner (eigene Session, siehe ZUSAMMENARBEIT.md).
4. Rechtstexte und Bedingungen einpflegen, Produktion einrichten, Umzug von WordPress.
+43
View File
@@ -2,10 +2,17 @@
namespace Tests\Feature;
use App\Actions\CreateReservation;
use App\Enums\UserRole;
use App\Filament\Pages\Operations;
use App\Mail\NewReservation;
use App\Mail\ReservationReceived;
use App\Models\Property;
use App\Models\User;
use App\Pricing\StayRequest;
use App\Support\Settings;
use Carbon\CarbonImmutable;
use Database\Seeders\PropertySeeder;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Mail\MailManager;
use Illuminate\Support\Facades\Mail;
@@ -47,6 +54,42 @@ public function test_switched_live_mails_reach_their_real_recipients(): void
$this->assertNull(Settings::mailRedirect());
}
public function test_addresses_of_the_internal_communication_are_set_in_the_admin(): void
{
config(['fewo.mail_redirect_to' => null]);
$this->actingAs(User::factory()->create());
Livewire::test(Operations::class)
->set('data.mode', Settings::MODE_LIVE)
->set('data.notification_recipients', ['brigitte@example.com', 'lars@example.com'])
->set('data.contact_email', 'info@example.com')
->set('data.sender_name', 'FeWo Test')
->set('data.sender_email', 'versand@example.com')
->call('save')
->assertHasNoErrors();
$this->assertSame(['brigitte@example.com', 'lars@example.com'], Settings::notificationRecipients());
$this->assertSame(['info@example.com', 'versand@example.com', 'FeWo Test'], [config('fewo.owner.email'), config('mail.from.address'), config('mail.from.name')]);
Mail::fake();
$this->seed(PropertySeeder::class);
$booking = app(CreateReservation::class)->handle(Property::sole(), new StayRequest(CarbonImmutable::parse('2026-12-01'), CarbonImmutable::parse('2026-12-05'), 2), ['first_name' => 'Erika', 'last_name' => 'Muster', 'email' => 'erika@example.com']);
Mail::assertSent(NewReservation::class, fn (NewReservation $mail): bool => $mail->hasTo('brigitte@example.com') && $mail->hasTo('lars@example.com'));
Mail::assertSent(ReservationReceived::class, fn (ReservationReceived $mail): bool => $mail->hasReplyTo('info@example.com'));
$this->assertNotNull($booking);
}
public function test_invalid_notification_addresses_are_rejected(): void
{
$this->actingAs(User::factory()->create());
Livewire::test(Operations::class)
->set('data.notification_recipients', ['keine-adresse'])
->call('save')
->assertHasErrors();
}
public function test_server_override_always_wins(): void
{
config(['fewo.mail_redirect_to' => 'server@example.com']);