adrema/app/Payment/PaymentMail.php

44 lines
1017 B
PHP
Raw Normal View History

2021-07-18 21:38:00 +02:00
<?php
namespace App\Payment;
use App\Pdf\PdfRepository;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
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
{
use Queueable, SerializesModels;
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));
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
}
}