Interner Beleg über jede versendete Buchungsbestätigung im Rechts-/Service-Postfach (config legal.contact_email). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
51 lines
1.5 KiB
PHP
51 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Mail;
|
|
|
|
use App\Models\Invoice;
|
|
use App\Models\User;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Mail\Mailables\Content;
|
|
use Illuminate\Mail\Mailables\Envelope;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
/**
|
|
* Zahlungs-/Buchungsbestätigung an den Kunden, sobald eine bezahlte
|
|
* Stripe-Rechnung in den STR-Kreis gespiegelt wurde — greift damit für
|
|
* jede Buchungsart (Tarif inkl. Verlängerung, Einzel-PM, Credits).
|
|
*
|
|
* Transaktionsmail: bewusst ohne Opt-out (analog Kündigungs-/
|
|
* Widerrufsbestätigungen, siehe EmailNotificationType-Doku).
|
|
*/
|
|
class BookingPaymentConfirmed extends Mailable implements ShouldQueue
|
|
{
|
|
use Queueable, SerializesModels;
|
|
|
|
public string $invoicesUrl;
|
|
|
|
public function __construct(
|
|
public readonly User $user,
|
|
public readonly Invoice $invoice,
|
|
) {
|
|
$this->invoicesUrl = route('me.invoices.index');
|
|
}
|
|
|
|
public function envelope(): Envelope
|
|
{
|
|
// Blindkopie an das Rechts-/Service-Postfach: interner Beleg über
|
|
// jede versendete Zahlungsbestätigung.
|
|
$bcc = (string) config('legal.contact_email');
|
|
|
|
return new Envelope(
|
|
subject: 'Zahlungsbestätigung für Ihre Buchung — Rechnung '.$this->invoice->number,
|
|
bcc: $bcc !== '' ? [$bcc] : [],
|
|
);
|
|
}
|
|
|
|
public function content(): Content
|
|
{
|
|
return new Content(view: 'emails.billing.payment-confirmed');
|
|
}
|
|
}
|