add konto

This commit is contained in:
philipp lang 2023-03-23 00:45:26 +01:00
parent eacb65064f
commit 2a07614388
2 changed files with 28 additions and 2 deletions

View File

@ -68,9 +68,9 @@ class EventForm extends ComponentBase
'lastname' => Input::get('lastname'), 'lastname' => Input::get('lastname'),
'email' => Input::get('email'), 'email' => Input::get('email'),
'event_id' => $this->event->id, 'event_id' => $this->event->id,
'payload' => Input::all(), 'payload' => $this->event->transformInputs(Input::all()),
]); ]);
Mail::send('confirm_'.$this->event->slug, ['data' => Input::all()], function ($message) use ($participant) { Mail::send('confirm_'.$this->event->slug, ['data' => $participant->payload], function ($message) use ($participant) {
$message->to($participant->email, $participant->firstname.' '.$participant->lastname); $message->to($participant->email, $participant->firstname.' '.$participant->lastname);
}); });

View File

@ -91,4 +91,30 @@ class Event extends Model
return Jsonfile::find($file)->getVar($v); return Jsonfile::find($file)->getVar($v);
} }
public function transformInputs($input)
{
$konto = [
'Gallier' => 'DE62 3305 0000 0000 7550 82',
'Gandalf' => 'DE47 3706 0193 0034 4200 17',
'Gravenrode' => 'DE13 3425 0000 0000 4010 83',
'Lennep' => 'DE58 3706 0193 0031 2770 19',
'Silva' => 'DE40 3425 0000 0000 2145 51',
'Sugambrer' => 'DE49 3425 0000 0000 0316 41',
'Tenkterer' => 'DE61 3425 0000 0000 7076 12',
'von Berg' => 'DE32 3425 0000 0001 9209 25',
];
if ('bela' === $this->slug) {
$input['konto'] = data_get($input, 'group') && data_get($konto, $input['group'])
? data_get($konto, $input['group'])
: 'Das Bezirkskonto';
$input['zweck'] = 'Bezirkslager '.data_get($input, 'firstname').' '.data_get($input, 'lastname');
$input['betrag'] = '160,00 €';
return $input;
}
return $input;
}
} }