2021-07-18 21:38:00 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Payment;
|
|
|
|
|
|
|
|
use App\Pdf\PdfRepository;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
use Illuminate\Mail\Mailable;
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
2021-10-29 22:02:21 +02:00
|
|
|
use Illuminate\Support\Str;
|
2021-07-18 21:38:00 +02:00
|
|
|
|
|
|
|
class PaymentMail extends Mailable
|
|
|
|
{
|
2022-03-11 20:19:17 +01:00
|
|
|
use Queueable;
|
|
|
|
use SerializesModels;
|
|
|
|
|
2021-07-18 21:38:00 +02:00
|
|
|
public PdfRepository $repo;
|
|
|
|
public string $filename;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new message instance.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function __construct(PdfRepository $repo, string $filename)
|
|
|
|
{
|
|
|
|
$this->filename = $filename;
|
|
|
|
$this->repo = $repo;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Build the message.
|
|
|
|
*
|
|
|
|
* @return $this
|
|
|
|
*/
|
|
|
|
public function build()
|
|
|
|
{
|
2021-10-29 22:02:21 +02:00
|
|
|
$template = Str::snake(class_basename($this->repo));
|
2022-03-11 20:19:17 +01:00
|
|
|
|
2021-10-29 22:02:21 +02:00
|
|
|
return $this->markdown('mail.payment.'.$template)
|
2021-07-18 21:38:00 +02:00
|
|
|
->attach($this->filename)
|
|
|
|
->replyTo('kasse@stamm-silva.de')
|
2021-10-29 22:02:21 +02:00
|
|
|
->subject($this->repo->getMailSubject().' | DPSG Stamm Silva');
|
2021-07-18 21:38:00 +02:00
|
|
|
}
|
|
|
|
}
|