Add mail
This commit is contained in:
parent
a5a04d1a33
commit
6183abfb6e
|
@ -89,4 +89,11 @@ class Plugin extends PluginBase
|
|||
],
|
||||
];
|
||||
}
|
||||
|
||||
public function registerMailTemplates()
|
||||
{
|
||||
return [
|
||||
'zoomyboy.event::mail.confirm',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,22 +13,22 @@ export default function (toasted) {
|
|||
|
||||
return {
|
||||
data: {
|
||||
firstname: '',
|
||||
lastname: '',
|
||||
address: '',
|
||||
zip: '',
|
||||
location: '',
|
||||
firstname: 'Philipp',
|
||||
lastname: 'Lang',
|
||||
address: 'Itterstr 3',
|
||||
zip: '42719',
|
||||
location: 'Solingen',
|
||||
food_preferences: [],
|
||||
activity: 'Teilnehmer*in',
|
||||
gender: '',
|
||||
email: '',
|
||||
birthday: '',
|
||||
agegroup: '',
|
||||
group: '',
|
||||
agegroup_leader: '',
|
||||
emergency_phone: '',
|
||||
phone: '',
|
||||
misc: '',
|
||||
gender: 'Weiblich',
|
||||
email: 'philipp@aaa.de',
|
||||
birthday: '1991-06-20',
|
||||
agegroup: 'Leiter*in',
|
||||
group: 'Gandalf',
|
||||
agegroup_leader: 'Wölfling',
|
||||
emergency_phone: '+49 1756 70342425',
|
||||
phone: '+49 176 70342420',
|
||||
misc: 'Lrem ipfrgfg',
|
||||
foto: false,
|
||||
vorteam: null,
|
||||
},
|
||||
|
@ -36,7 +36,7 @@ export default function (toasted) {
|
|||
finished: false,
|
||||
submitRequest: null,
|
||||
errorFields: [],
|
||||
active: 0,
|
||||
active: 3,
|
||||
slides: [
|
||||
'Persönliches',
|
||||
'Veranstaltung',
|
||||
|
@ -61,7 +61,7 @@ export default function (toasted) {
|
|||
{"id": "Jungpfadfinder", "name": "Jungpfadfinder"},
|
||||
{"id": "Pfadfinder", "name": "Pfadfinder"},
|
||||
{"id": "Rover", "name": "Rover"},
|
||||
{"id": "Leiter", "name": "Leiter"},
|
||||
{"id": "Leiter*in", "name": "Leiter*in"},
|
||||
],
|
||||
agegroups_leaders: [
|
||||
{"id": "Biber", "name": "Biber"},
|
||||
|
|
|
@ -5,6 +5,7 @@ namespace Zoomyboy\Event\Components;
|
|||
use Cms\Classes\ComponentBase;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Facades\Lang;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Input;
|
||||
use Winter\Storm\Support\Facades\Validator;
|
||||
use Zoomyboy\Event\Models\Participant;
|
||||
|
@ -58,9 +59,13 @@ class EventForm extends ComponentBase
|
|||
return response()->json($validator->errors(), 422);
|
||||
}
|
||||
|
||||
Participant::create(array_merge($validator->validated(), [
|
||||
$participant = Participant::create(array_merge($validator->validated(), [
|
||||
'vorteam' => 'Ja' === Input::get('vorteam'),
|
||||
]));
|
||||
Mail::send('zoomyboy.event::mail.confirm', ['data' => $participant, 'until' => '1.9.2023', 'iban' => 'XXX', 'birthday' => $participant->birthday->format('d.m.Y')], function ($message) use ($participant) {
|
||||
$message->to($participant->email, $participant->firstname.' '.$participant->lastname);
|
||||
$message->subject('Deine Anmeldung fürs Bezirkslager');
|
||||
});
|
||||
|
||||
return response()->json([], 201);
|
||||
}
|
||||
|
|
|
@ -160,10 +160,10 @@
|
|||
{{ form.select(_context, 'group', 'Stamm', false, 'groups') }}
|
||||
{{ form.field(_context, 'emergency_phone', 'Notfallkontakt (Tel)', true) }}
|
||||
{{ form.select(_context, 'agegroup', 'Stufe (zum Zeitpunkt des Lagers)', true, 'agegroups') }}
|
||||
<template x-if="data.agegroup === 'Leiter'">
|
||||
<template x-if="data.agegroup === 'Leiter*in'">
|
||||
{{ form.select(_context, 'agegroup_leader', 'Stufe die du leitest', false, 'agegroups_leaders') }}
|
||||
</template>
|
||||
<template x-if="data.agegroup !== 'Leiter'">
|
||||
<template x-if="data.agegroup !== 'Leiter*in'">
|
||||
<div></div>
|
||||
</template>
|
||||
<template x-if="data.activity === 'Orga'">
|
||||
|
@ -176,7 +176,7 @@
|
|||
|
||||
<div class="{{gliderElClass}}">
|
||||
<div class="{{descClass}}">Fast geschafft! Wenn du sonst noch etwas loswerden willst, kannst du das hier tun.</div>
|
||||
<div class="flex flex-row items-center p-4 bg-red-100 border-2 border-red-400 rounded form-group shadow-sm relative" x-show="data.agegroup === 'Leiter'">
|
||||
<div class="flex flex-row items-center p-4 bg-red-100 border-2 border-red-400 rounded form-group shadow-sm relative" x-show="data.agegroup === 'Leiter*in'">
|
||||
<div class="flex items-center justify-center w-8 h-8 mr-3 bg-red-500 rounded-full flex-none absolute sm:static top-0 -mt-4 sm:-mt-0">
|
||||
<div class="flex items-center justify-center w-5 h-5 bg-red-100 rounded-full">
|
||||
<svg class="w-5 h-5 text-red-700 border-gray-400 fill-current border-5 fill-current"><use xlink:href="/themes/october-theme/resources/img/sprite.svg#exclamation"></use></svg>
|
||||
|
|
|
@ -57,6 +57,7 @@ class Participant extends Model
|
|||
protected $dates = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'birthday',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue