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 {
|
return {
|
||||||
data: {
|
data: {
|
||||||
firstname: '',
|
firstname: 'Philipp',
|
||||||
lastname: '',
|
lastname: 'Lang',
|
||||||
address: '',
|
address: 'Itterstr 3',
|
||||||
zip: '',
|
zip: '42719',
|
||||||
location: '',
|
location: 'Solingen',
|
||||||
food_preferences: [],
|
food_preferences: [],
|
||||||
activity: 'Teilnehmer*in',
|
activity: 'Teilnehmer*in',
|
||||||
gender: '',
|
gender: 'Weiblich',
|
||||||
email: '',
|
email: 'philipp@aaa.de',
|
||||||
birthday: '',
|
birthday: '1991-06-20',
|
||||||
agegroup: '',
|
agegroup: 'Leiter*in',
|
||||||
group: '',
|
group: 'Gandalf',
|
||||||
agegroup_leader: '',
|
agegroup_leader: 'Wölfling',
|
||||||
emergency_phone: '',
|
emergency_phone: '+49 1756 70342425',
|
||||||
phone: '',
|
phone: '+49 176 70342420',
|
||||||
misc: '',
|
misc: 'Lrem ipfrgfg',
|
||||||
foto: false,
|
foto: false,
|
||||||
vorteam: null,
|
vorteam: null,
|
||||||
},
|
},
|
||||||
|
@ -36,7 +36,7 @@ export default function (toasted) {
|
||||||
finished: false,
|
finished: false,
|
||||||
submitRequest: null,
|
submitRequest: null,
|
||||||
errorFields: [],
|
errorFields: [],
|
||||||
active: 0,
|
active: 3,
|
||||||
slides: [
|
slides: [
|
||||||
'Persönliches',
|
'Persönliches',
|
||||||
'Veranstaltung',
|
'Veranstaltung',
|
||||||
|
@ -61,7 +61,7 @@ export default function (toasted) {
|
||||||
{"id": "Jungpfadfinder", "name": "Jungpfadfinder"},
|
{"id": "Jungpfadfinder", "name": "Jungpfadfinder"},
|
||||||
{"id": "Pfadfinder", "name": "Pfadfinder"},
|
{"id": "Pfadfinder", "name": "Pfadfinder"},
|
||||||
{"id": "Rover", "name": "Rover"},
|
{"id": "Rover", "name": "Rover"},
|
||||||
{"id": "Leiter", "name": "Leiter"},
|
{"id": "Leiter*in", "name": "Leiter*in"},
|
||||||
],
|
],
|
||||||
agegroups_leaders: [
|
agegroups_leaders: [
|
||||||
{"id": "Biber", "name": "Biber"},
|
{"id": "Biber", "name": "Biber"},
|
||||||
|
|
|
@ -5,6 +5,7 @@ namespace Zoomyboy\Event\Components;
|
||||||
use Cms\Classes\ComponentBase;
|
use Cms\Classes\ComponentBase;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Support\Facades\Lang;
|
use Illuminate\Support\Facades\Lang;
|
||||||
|
use Illuminate\Support\Facades\Mail;
|
||||||
use Input;
|
use Input;
|
||||||
use Winter\Storm\Support\Facades\Validator;
|
use Winter\Storm\Support\Facades\Validator;
|
||||||
use Zoomyboy\Event\Models\Participant;
|
use Zoomyboy\Event\Models\Participant;
|
||||||
|
@ -58,9 +59,13 @@ class EventForm extends ComponentBase
|
||||||
return response()->json($validator->errors(), 422);
|
return response()->json($validator->errors(), 422);
|
||||||
}
|
}
|
||||||
|
|
||||||
Participant::create(array_merge($validator->validated(), [
|
$participant = Participant::create(array_merge($validator->validated(), [
|
||||||
'vorteam' => 'Ja' === Input::get('vorteam'),
|
'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);
|
return response()->json([], 201);
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,10 +160,10 @@
|
||||||
{{ form.select(_context, 'group', 'Stamm', false, 'groups') }}
|
{{ form.select(_context, 'group', 'Stamm', false, 'groups') }}
|
||||||
{{ form.field(_context, 'emergency_phone', 'Notfallkontakt (Tel)', true) }}
|
{{ form.field(_context, 'emergency_phone', 'Notfallkontakt (Tel)', true) }}
|
||||||
{{ form.select(_context, 'agegroup', 'Stufe (zum Zeitpunkt des Lagers)', true, 'agegroups') }}
|
{{ 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') }}
|
{{ form.select(_context, 'agegroup_leader', 'Stufe die du leitest', false, 'agegroups_leaders') }}
|
||||||
</template>
|
</template>
|
||||||
<template x-if="data.agegroup !== 'Leiter'">
|
<template x-if="data.agegroup !== 'Leiter*in'">
|
||||||
<div></div>
|
<div></div>
|
||||||
</template>
|
</template>
|
||||||
<template x-if="data.activity === 'Orga'">
|
<template x-if="data.activity === 'Orga'">
|
||||||
|
@ -176,7 +176,7 @@
|
||||||
|
|
||||||
<div class="{{gliderElClass}}">
|
<div class="{{gliderElClass}}">
|
||||||
<div class="{{descClass}}">Fast geschafft! Wenn du sonst noch etwas loswerden willst, kannst du das hier tun.</div>
|
<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-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">
|
<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>
|
<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 = [
|
protected $dates = [
|
||||||
'created_at',
|
'created_at',
|
||||||
'updated_at',
|
'updated_at',
|
||||||
|
'birthday',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue