feat: additional email notifications
This commit is contained in:
@@ -53,8 +53,9 @@ class EmailNotificationSubscriber implements EventSubscriberInterface
|
||||
public function onDocumentUploaded(DocumentUploadedEvent $event): void
|
||||
{
|
||||
$document = $event->getDocument();
|
||||
$documentType = $document->getType();
|
||||
|
||||
if (Upload::TYPE_INVOICE === $document->getType()) {
|
||||
if (in_array($documentType, [Upload::TYPE_INVOICE, Upload::TYPE_CONTRACT])) {
|
||||
$disposition = $document->getDisposition();
|
||||
$hotelCode = $disposition
|
||||
->getAssignment()
|
||||
@@ -67,16 +68,25 @@ class EmailNotificationSubscriber implements EventSubscriberInterface
|
||||
->getUsersByRoleAndHotelCode('ROLE_MANAGER', $hotelCode)
|
||||
;
|
||||
|
||||
if (Upload::TYPE_INVOICE === $documentType) {
|
||||
$subject = 'Honorarnote hochgeladen';
|
||||
$template = 'email/invoice_uploaded.html.twig';
|
||||
} else {
|
||||
$subject = 'Honorarvertrag hochgeladen';
|
||||
$template = 'email/contract_uploaded.html.twig';
|
||||
}
|
||||
|
||||
foreach ($managers as $manager) {
|
||||
if (true === $manager->isMuteNotifications()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->mailer->createAndSendEmail([
|
||||
'disposition' => $disposition,
|
||||
], [
|
||||
'to' => $manager->getEmail(),
|
||||
'subject' => 'Honorarnote hochgeladen',
|
||||
'template' => 'email/invoice_uploaded.html.twig',
|
||||
'subject' => $subject,
|
||||
'template' => $template,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
{% extends 'email/layout.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1>
|
||||
Honorvertrag hochgeladen
|
||||
</h1>
|
||||
<p>
|
||||
Es wurde ein neuer Honorarvertrag von {{ disposition.teamer }} hochgeladen, schau ihn dir an.
|
||||
</p>
|
||||
<p>
|
||||
<a href="{{ url('app_teamer_index') }}" class="button">
|
||||
Zum Portal
|
||||
</a>
|
||||
</p>
|
||||
{% endblock %}
|
||||
@@ -5,9 +5,7 @@
|
||||
Honorarnote hochgeladen
|
||||
</h1>
|
||||
<p>
|
||||
<strong>{{ disposition.teamer }}</strong> hat eine Honorarnote zum Einsatz
|
||||
<strong>{{ disposition.assignment.jobProfile.name }} {{ disposition.assignment.destination}}</strong>
|
||||
hochgeladen.
|
||||
Es wurde eine neue Honorarnote von {{ disposition.teamer }} hochgeladen, gib diese bitte frei.
|
||||
</p>
|
||||
<p>
|
||||
<a href="{{ url('app_teamer_index') }}" class="button">
|
||||
|
||||
Reference in New Issue
Block a user