--wip-- [skip ci]

This commit is contained in:
Philipp Lang 2022-11-07 16:42:25 +01:00
parent bf24da2f40
commit 7dba56a7cc
3 changed files with 16 additions and 5 deletions

View File

@ -105,4 +105,18 @@ abstract class Letter extends Document
}
}
}
/**
* @return view-string
*/
public function mailView(): string
{
$view = 'mail.payment.'.Str::snake(class_basename($this));
if (!view()->exists($view)) {
throw new Exception('Mail view '.$view.' existiert nicht.');
}
return $view;
}
}

View File

@ -6,7 +6,6 @@ use App\Letter\Letter;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Str;
class PaymentMail extends Mailable
{
@ -36,9 +35,7 @@ class PaymentMail extends Mailable
*/
public function build()
{
$template = Str::snake(class_basename($this->letter));
return $this->markdown('mail.payment.'.$template)
return $this->markdown($this->letter->mailView())
->attach($this->filename)
->replyTo('kasse@stamm-silva.de')
->subject($this->letter->getSubject().' | DPSG Stamm Silva');

View File

@ -10,7 +10,7 @@ parameters:
- packages/tex/src
# The level 8 is the highest level
level: 6
level: 7
ignoreErrors:
-