Sprache bei Mail; hinzufügen Spendenverordnung
This commit is contained in:
@@ -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'),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user