Chaos-Events und Voranmeldungen

This commit is contained in:
2026-03-28 02:16:58 +01:00
parent ba2dcb98e2
commit a99b8eb9c1
23 changed files with 485 additions and 33 deletions

View File

@@ -0,0 +1,66 @@
<?php
namespace App\Mail;
use AllowDynamicProperties;
use App;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Attachment;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
class PreApplicationMail extends Mailable
{
use Queueable, SerializesModels;
/**
* Create a new message instance.
*/
public function __construct(protected App\Models\PreApplications $pa, protected string $lang = 'de')
{
//
}
/**
* Get the message envelope.
*/
public function envelope(): Envelope
{
return new Envelope(
subject: __('mail.preapplication.subject'),
);
}
/**
* Get the message content definition.
*/
public function content(): Content
{
App::setLocale($this->lang);
return new Content(
view: 'mail.preapplication',
with: ['pa' => $this->pa],
);
}
/**
* Get the attachments for the message.
*
* @return array<int, Attachment>
*/
public function attachments(): array
{
$lang = match (App::getLocale()) {
'de' => 'dk',
'en' => 'ek',
default => 'dk',
};
return [
Attachment::fromPath(public_path('Dokumente/c3gov_fb5' . $lang . '.pdf'))
->withMime('application/pdf'),
];
}
}