Files
fewo-stommer/app/Mail/ReviewRequest.php
LarsandCursor 8ebc1a3878 Assign the existing site to one landlord so stommer.info can run tenancy.
Seebad 0.3 stays in this release. With a single landlord every host still reaches the default website.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-23 12:00:11 +02:00

40 lines
1.1 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;
use Illuminate\Support\Facades\URL;
/**
* Asks the guest for a review a few days after departure.
*/
class ReviewRequest extends Mailable
{
use Queueable, SerializesModels;
public function __construct(public Booking $booking) {}
public function envelope(): Envelope
{
return new Envelope(
subject: 'Wie war Ihr Aufenthalt in Kühlungsborn?',
replyTo: [new Address(config('fewo.owner.email'), config('fewo.owner.name'))],
);
}
public function content(): Content
{
return new Content(
with: ['url' => $this->booking->website()?->temporarySignedRoute('reviews.create', now()->addDays(90), ['booking' => $this->booking])
?? URL::temporarySignedRoute('reviews.create', now()->addDays(90), $this->booking)],
markdown: 'mail.review-request',
);
}
}