Participant mangement
This commit is contained in:
63
app/Mail/ParticipantCocMails/ParticipantCocCompleteMail.php
Normal file
63
app/Mail/ParticipantCocMails/ParticipantCocCompleteMail.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail\ParticipantCocMails;
|
||||
|
||||
use App\Models\EventParticipant;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Attachment;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
|
||||
class ParticipantCocCompleteMail extends Mailable {
|
||||
public function __construct(
|
||||
private EventParticipant $participant,
|
||||
)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message envelope.
|
||||
*/
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
$participant = $this->participant->toResource()->toArray(new Request());
|
||||
|
||||
$subject = 'Dein erweitertes Führungszeugnis wurde bestätigt';
|
||||
|
||||
return new Envelope(
|
||||
subject: $subject,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message content definition.
|
||||
*/
|
||||
public function content(): Content
|
||||
{
|
||||
$event = $this->participant->event()->first()->toResource()->toArray(new Request());
|
||||
$participant = $this->participant->toResource()->toArray(new Request());
|
||||
|
||||
return new Content(
|
||||
view: 'emails.cocCheck.coc_check_complete',
|
||||
with: [
|
||||
'name' => $participant['nicename'],
|
||||
'eventTitle' => $event['name'],
|
||||
'eventEmail' => $event['email'],
|
||||
'cocFinalDate' => $event['registrationFinalEnd']['formatted'],
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the attachments for the message.
|
||||
*
|
||||
* @return array<int, Attachment>
|
||||
*/
|
||||
public function attachments(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
63
app/Mail/ParticipantCocMails/ParticipantCocInvalidMail.php
Normal file
63
app/Mail/ParticipantCocMails/ParticipantCocInvalidMail.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail\ParticipantCocMails;
|
||||
|
||||
use App\Models\EventParticipant;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Attachment;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
|
||||
class ParticipantCocInvalidMail extends Mailable {
|
||||
public function __construct(
|
||||
private EventParticipant $participant,
|
||||
)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message envelope.
|
||||
*/
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
$participant = $this->participant->toResource()->toArray(new Request());
|
||||
|
||||
$subject = 'Bitte reiche ein erweiteres polizeiliches Führungszeugnis ein';
|
||||
|
||||
return new Envelope(
|
||||
subject: $subject,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message content definition.
|
||||
*/
|
||||
public function content(): Content
|
||||
{
|
||||
$event = $this->participant->event()->first()->toResource()->toArray(new Request());
|
||||
$participant = $this->participant->toResource()->toArray(new Request());
|
||||
|
||||
return new Content(
|
||||
view: 'emails.cocCheck.coc_check_invalid',
|
||||
with: [
|
||||
'name' => $participant['nicename'],
|
||||
'eventTitle' => $event['name'],
|
||||
'eventEmail' => $event['email'],
|
||||
'cocFinalDate' => $event['registrationFinalEnd']['formatted'],
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the attachments for the message.
|
||||
*
|
||||
* @return array<int, Attachment>
|
||||
*/
|
||||
public function attachments(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
namespace App\Mail\ParticipantParticipationMails;
|
||||
|
||||
use App\Enumerations\EfzStatus;
|
||||
use App\Models\EventParticipant;
|
||||
use App\Resources\EventParticipantResource;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Attachment;
|
||||
@@ -14,7 +11,7 @@ use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class EventSignUpSuccessfull extends Mailable
|
||||
class EventSignUpSuccessfullMail extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail\ParticipantParticipationMails;
|
||||
|
||||
use App\Models\EventParticipant;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Attachment;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
|
||||
class ParticipantSignOffMail extends Mailable
|
||||
{
|
||||
public function __construct(
|
||||
private EventParticipant $participant,
|
||||
)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message envelope.
|
||||
*/
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
$participant = $this->participant->toResource()->toArray(new Request());
|
||||
|
||||
$subject = sprintf(
|
||||
'Abmeldebestätigung %1$s %2$s',
|
||||
'für die Veranstaltung',
|
||||
$this->participant->event()->first()->name
|
||||
);
|
||||
|
||||
|
||||
return new Envelope(
|
||||
subject: $subject,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message content definition.
|
||||
*/
|
||||
public function content(): Content
|
||||
{
|
||||
$event = $this->participant->event()->first()->toResource()->toArray(new Request());
|
||||
$participant = $this->participant->toResource()->toArray(new Request());
|
||||
|
||||
return new Content(
|
||||
view: 'emails.events.participant_signed_off',
|
||||
with: [
|
||||
'name' => $participant['nicename'],
|
||||
'eventTitle' => $event['name'],
|
||||
'eventEmail' => $event['email'],
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the attachments for the message.
|
||||
*
|
||||
* @return array<int, Attachment>
|
||||
*/
|
||||
public function attachments(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail\ParticipantPaymentMails;
|
||||
|
||||
use App\Models\EventParticipant;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Attachment;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
|
||||
class ParticipantPaymentMissingPaymentMail extends Mailable
|
||||
{
|
||||
public function __construct(
|
||||
private EventParticipant $participant,
|
||||
)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message envelope.
|
||||
*/
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
$participant = $this->participant->toResource()->toArray(new Request());
|
||||
|
||||
$subject = sprintf(
|
||||
$participant['needs_payment'] ? 'Teilnahme- & Zahlungsinformationen %1$s %2$s' : 'Anmeldebestätigung %1$s %2$s',
|
||||
'für die Veranstaltung',
|
||||
$this->participant->event()->first()->name
|
||||
);
|
||||
|
||||
|
||||
return new Envelope(
|
||||
subject: $subject,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message content definition.
|
||||
*/
|
||||
public function content(): Content
|
||||
{
|
||||
$event = $this->participant->event()->first()->toResource()->toArray(new Request());
|
||||
$participant = $this->participant->toResource()->toArray(new Request());
|
||||
|
||||
$girocodeProvider = new \App\Providers\GiroCodeProvider(
|
||||
$event['accountOwner'],
|
||||
$event['accountIban'],
|
||||
(float) $participant['amount_left_value'],
|
||||
$participant['payment_purpose']
|
||||
);
|
||||
$girocodeBinary = (string)$girocodeProvider->create();
|
||||
|
||||
return new Content(
|
||||
view: 'emails.participantPayments.missing_amount',
|
||||
with: [
|
||||
'participationType' => $participant['participationType'],
|
||||
'name' => $participant['nicename'],
|
||||
'eventTitle' => $event['name'],
|
||||
'eventEmail' => $event['email'],
|
||||
'arrival' => $participant['arrival'],
|
||||
'departure' => $participant['departure'],
|
||||
'amount' => $participant['amount_left_string'],
|
||||
'paymentFinalDate' => $event['registrationFinalEnd']['formatted'],
|
||||
'paymentRequired' => $participant['needs_payment'],
|
||||
'accountOwner' => $event['accountOwner'],
|
||||
'accountIban' => $event['accountIban'],
|
||||
'paymentPurpose' => $participant['payment_purpose'],
|
||||
'girocodeBinary' => $girocodeBinary,
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the attachments for the message.
|
||||
*
|
||||
* @return array<int, Attachment>
|
||||
*/
|
||||
public function attachments(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail\ParticipantPaymentMails;
|
||||
|
||||
use App\Models\EventParticipant;
|
||||
use App\ValueObjects\Amount;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Attachment;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
|
||||
class ParticipantPaymentOverpaidMail extends Mailable
|
||||
{
|
||||
public function __construct(
|
||||
private EventParticipant $participant,
|
||||
)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message envelope.
|
||||
*/
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
$participant = $this->participant->toResource()->toArray(new Request());
|
||||
|
||||
$subject = sprintf(
|
||||
'Überzahlung des Beitrags %1$s%2$s',
|
||||
'für die Veranstaltung',
|
||||
$this->participant->event()->first()->name
|
||||
);
|
||||
|
||||
|
||||
return new Envelope(
|
||||
subject: $subject,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message content definition.
|
||||
*/
|
||||
public function content(): Content
|
||||
{
|
||||
$event = $this->participant->event()->first()->toResource()->toArray(new Request());
|
||||
$participant = $this->participant->toResource()->toArray(new Request());
|
||||
|
||||
$overpaidAmount = Amount::fromString($participant['amount_left_value'] * -1)->toString();
|
||||
|
||||
return new Content(
|
||||
view: 'emails.participantPayments.amount_overpaid',
|
||||
with: [
|
||||
'participationType' => $participant['participationType'],
|
||||
'name' => $participant['nicename'],
|
||||
'eventTitle' => $event['name'],
|
||||
'eventEmail' => $event['email'],
|
||||
'arrival' => $participant['arrival'],
|
||||
'departure' => $participant['departure'],
|
||||
'amount' => $participant['amountExpected']['readable'],
|
||||
'amount_paid' => $participant['amountPaid']['readable'],
|
||||
'overpaidAmount' => $overpaidAmount,
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the attachments for the message.
|
||||
*
|
||||
* @return array<int, Attachment>
|
||||
*/
|
||||
public function attachments(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail\ParticipantPaymentMails;
|
||||
|
||||
use App\Models\EventParticipant;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Attachment;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
|
||||
class ParticipantPaymentPaidMail extends Mailable
|
||||
{
|
||||
public function __construct(
|
||||
private EventParticipant $participant,
|
||||
)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message envelope.
|
||||
*/
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
$participant = $this->participant->toResource()->toArray(new Request());
|
||||
|
||||
$subject = sprintf(
|
||||
'Anmeldebestätigung %1$s %2$s',
|
||||
'für die Veranstaltung',
|
||||
$this->participant->event()->first()->name
|
||||
);
|
||||
|
||||
|
||||
return new Envelope(
|
||||
subject: $subject,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message content definition.
|
||||
*/
|
||||
public function content(): Content
|
||||
{
|
||||
$event = $this->participant->event()->first()->toResource()->toArray(new Request());
|
||||
$participant = $this->participant->toResource()->toArray(new Request());
|
||||
|
||||
return new Content(
|
||||
view: 'emails.participantPayments.amount_paid',
|
||||
with: [
|
||||
'participationType' => $participant['participationType'],
|
||||
'name' => $participant['nicename'],
|
||||
'eventTitle' => $event['name'],
|
||||
'eventEmail' => $event['email'],
|
||||
'arrival' => $participant['arrival'],
|
||||
'departure' => $participant['departure'],
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the attachments for the message.
|
||||
*
|
||||
* @return array<int, Attachment>
|
||||
*/
|
||||
public function attachments(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user