Files
fewo-stommer/app/Mail/MarketingConsentRequest.php
T
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.2 KiB
PHP

<?php
namespace App\Mail;
use App\Models\Guest;
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;
/**
* Double opt-in: the guest confirms that they want to receive offers.
*/
class MarketingConsentRequest extends Mailable
{
use Queueable, SerializesModels;
public function __construct(public Guest $guest) {}
public function envelope(): Envelope
{
return new Envelope(
subject: 'Bitte bestätigen: Angebote der Ferienwohnung Stommer',
replyTo: [new Address(config('fewo.owner.email'), config('fewo.owner.name'))],
);
}
public function content(): Content
{
return new Content(
with: ['url' => $this->guest->website()?->temporarySignedRoute('marketing.confirm', now()->addDays(14), ['guest' => $this->guest])
?? URL::temporarySignedRoute('marketing.confirm', now()->addDays(14), $this->guest)],
markdown: 'mail.marketing-consent-request',
);
}
}