- Zahlungen erfassen (inkl. Erstattungen), Status automatisch: Bestätigt → Anzahlung erhalten → Bezahlt → Abgeschlossen - Anzahlungsfrist bei Bestätigung; kurzfristige Buchungen: Gesamtbetrag sofort - Mietvertrag als PDF (dompdf, Font-Subsetting), bei Bestätigung gespeichert und angehängt; Texte im Admin (Muster) - Täglich: Zahlungserinnerungen (Anzahlung/Rest überfällig, Kopie an Vermieter), Zahlungsaufforderung Rest 7 Tage vorher, Anreiseinfos 7 Tage vorher, Abschluss nach Abreise - Admin: Zahlungen je Buchung, offene Beträge, Vertrag herunterladen/neu erzeugen Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
51 lines
1.7 KiB
PHP
51 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Mail;
|
|
|
|
use App\Models\Booking;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Mail\Mailables\Address;
|
|
use Illuminate\Mail\Mailables\Content;
|
|
use Illuminate\Mail\Mailables\Envelope;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
/**
|
|
* Payment request or reminder to the guest. Overdue reminders are copied to the landlord.
|
|
*/
|
|
class PaymentReminder extends Mailable
|
|
{
|
|
use Queueable, SerializesModels;
|
|
|
|
public const DEPOSIT_OVERDUE = 'deposit_overdue';
|
|
|
|
public const BALANCE_REQUEST = 'balance_request';
|
|
|
|
public const BALANCE_OVERDUE = 'balance_overdue';
|
|
|
|
public function __construct(public Booking $booking, public string $kind) {}
|
|
|
|
public function envelope(): Envelope
|
|
{
|
|
return new Envelope(
|
|
subject: match ($this->kind) {
|
|
self::BALANCE_REQUEST => "Restzahlung für Ihre Buchung {$this->booking->reference}",
|
|
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'))],
|
|
);
|
|
}
|
|
|
|
public function content(): Content
|
|
{
|
|
return new Content(
|
|
markdown: 'mail.payment-reminder',
|
|
with: [
|
|
'amount' => $this->kind === self::DEPOSIT_OVERDUE && ! $this->booking->requiresFullPayment() ? $this->booking->openDeposit() : $this->booking->openAmount(),
|
|
'dueOn' => $this->kind === self::DEPOSIT_OVERDUE ? $this->booking->deposit_due_on : $this->booking->balance_due_on,
|
|
],
|
|
);
|
|
}
|
|
}
|