Deploy FeWo mit PipelineManager / deploy (push) Successful in 3m59s
Eine Zusammenstellung vor jedem Dokument (Angebot, Bestaetigung, Buchungsunterlagen extern), Dokumentart je Vorgangsart, Freigaben fuer Vorlagen und Dokumentarten, Schutz vor unvereinbarten Bedingungen bei Portalbuchungen (E-004), kein doppelter Versand, Absicherung Hold 0 bis Paket 7, A6-Aufenthaltsbestaetigung vorbereitet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
48 lines
1.4 KiB
PHP
48 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Mail;
|
|
|
|
use App\Documents\RentalContract;
|
|
use App\Models\Booking;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Mail\Mailables\Address;
|
|
use Illuminate\Mail\Mailables\Attachment;
|
|
use Illuminate\Mail\Mailables\Content;
|
|
use Illuminate\Mail\Mailables\Envelope;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
/**
|
|
* The booking documentation for a booking already binding on a portal (A3/A4): the stay as booked there and our
|
|
* document, without an acceptance link and without a cancellation link of our own (E-004).
|
|
*/
|
|
class BookingDocumentation extends Mailable
|
|
{
|
|
use Queueable, SerializesModels;
|
|
|
|
public function __construct(public Booking $booking) {}
|
|
|
|
public function envelope(): Envelope
|
|
{
|
|
return new Envelope(
|
|
subject: 'Ihre Buchungsunterlagen '.($this->booking->portal_reference ?? $this->booking->reference),
|
|
replyTo: [new Address(config('fewo.owner.email'), config('fewo.owner.name'))],
|
|
);
|
|
}
|
|
|
|
public function content(): Content
|
|
{
|
|
return new Content(markdown: 'mail.booking-documentation');
|
|
}
|
|
|
|
/**
|
|
* @return list<Attachment>
|
|
*/
|
|
public function attachments(): array
|
|
{
|
|
$path = app(RentalContract::class)->absolutePath($this->booking);
|
|
|
|
return $path ? [Attachment::fromPath($path)->as("Buchungsunterlagen-{$this->booking->reference}.pdf")->withMime('application/pdf')] : [];
|
|
}
|
|
}
|