37 lines
839 B
PHP
37 lines
839 B
PHP
<?php
|
|
|
|
namespace App\Mail;
|
|
|
|
use App\Models\Invoice;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Mail\Mailables\Content;
|
|
use Illuminate\Mail\Mailables\Envelope;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class InvoiceMail extends Mailable
|
|
{
|
|
use Queueable, SerializesModels;
|
|
|
|
public function __construct(
|
|
public Invoice $invoice
|
|
) {}
|
|
|
|
public function envelope(): Envelope
|
|
{
|
|
return new Envelope(
|
|
subject: "Invoice {$this->invoice->invoice_number} - Payment Requested",
|
|
);
|
|
}
|
|
|
|
public function content(): Content
|
|
{
|
|
return new Content(
|
|
view: 'emails.invoice',
|
|
with: [
|
|
'invoice' => $this->invoice,
|
|
'invoiceUrl' => route('invoices.show', $this->invoice),
|
|
],
|
|
);
|
|
}
|
|
} |