adrema/app/Payment/PaymentMail.php

44 lines
1000 B
PHP
Raw Permalink Normal View History

2021-07-18 21:38:00 +02:00
<?php
namespace App\Payment;
2023-04-18 22:08:45 +02:00
use App\Invoice\Invoice;
2021-07-18 21:38:00 +02:00
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class PaymentMail extends Mailable
{
2022-03-11 20:19:17 +01:00
use Queueable;
use SerializesModels;
2023-04-18 22:08:45 +02:00
public Invoice $invoice;
2021-07-18 21:38:00 +02:00
public string $filename;
2022-11-07 16:18:11 +01:00
public string $salutation;
2021-07-18 21:38:00 +02:00
/**
* Create a new message instance.
*
* @return void
*/
2023-04-18 22:08:45 +02:00
public function __construct(Invoice $invoice, string $filename)
2021-07-18 21:38:00 +02:00
{
2023-04-18 22:08:45 +02:00
$this->invoice = $invoice;
2021-07-18 21:38:00 +02:00
$this->filename = $filename;
2023-04-18 22:08:45 +02:00
$this->salutation = 'Liebe Familie '.$invoice->pages->first()->familyName;
2021-07-18 21:38:00 +02:00
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
2023-04-18 22:08:45 +02:00
return $this->markdown($this->invoice->mailView())
2021-07-18 21:38:00 +02:00
->attach($this->filename)
->replyTo('kasse@stamm-silva.de')
2023-04-18 22:08:45 +02:00
->subject($this->invoice->getSubject().' | DPSG Stamm Silva');
2021-07-18 21:38:00 +02:00
}
}