Sprache bei Mail; hinzufügen Spendenverordnung

This commit is contained in:
2026-03-30 23:05:31 +02:00
parent 6706c7e764
commit 0ba3158bb4
9 changed files with 67 additions and 33 deletions

View File

@@ -22,6 +22,7 @@ class PreApplicationMail extends Mailable
public function __construct(protected App\Models\PreApplications $pa, protected string $lang = 'de')
{
//
$this->locale($this->lang);
}
/**
@@ -39,7 +40,6 @@ class PreApplicationMail extends Mailable
*/
public function content(): Content
{
App::setLocale($this->lang);
return new Content(
view: 'mail.preapplication',
with: ['pa' => $this->pa],
@@ -53,13 +53,21 @@ class PreApplicationMail extends Mailable
*/
public function attachments(): array
{
$lang = match (App::getLocale()) {
$langFb = match ($this->locale) {
'de' => 'dk',
'en' => 'ek',
default => 'dk',
};
$langDonation = match ($this->locale) {
'de' => '',
'en' => '_en',
};
return [
Attachment::fromPath(public_path('Dokumente/c3gov_fb5' . $lang . '.pdf'))
Attachment::fromPath(public_path('Dokumente/c3gov_fb5' . $langFb . '.pdf'))
->withMime('application/pdf'),
Attachment::fromPath(public_path('Dokumente/C3GovSpGV' . $langDonation . '.pdf'))
->withMime('application/pdf'),
];
}