feat: notify configured recipients when something is booked
This commit is contained in:
1 parent
be37fc81f6
commit
d287cb2600
23 files changed
+1014
-1
No files matched your search
@@ -0,0 +1,31 @@
|
||||
{# Who is notified about new bookings of one kind. See admin/_modal_resource.html.twig for how it closes. #}
|
||||
{% extends 'htmx_modal.html.twig' %}
|
||||
|
||||
{% block title %}Benachrichtigungen · {{ type.plural }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{{ form_start(form, { attr: {
|
||||
'hx-post': form.vars.action,
|
||||
'hx-target': '#htmx-modal',
|
||||
'hx-swap': 'outerHTML',
|
||||
} }) }}
|
||||
{{ form_errors(form) }}
|
||||
|
||||
<p class="pb-4 text-sm text-gray-500">
|
||||
Diese Adressen erhalten eine E-Mail, sobald {{ type.plural }} gebucht werden.
|
||||
</p>
|
||||
|
||||
<div class="space-y-4">
|
||||
{{ form_row(form.notificationRecipients) }}
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end gap-2 pt-6">
|
||||
<button type="button" class="button button--neutral" {{ stimulus_action('modal', 'close') }}>
|
||||
Abbrechen
|
||||
</button>
|
||||
<button type="submit" class="button button--primary">
|
||||
Speichern
|
||||
</button>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
@@ -53,6 +53,10 @@
|
||||
<div class="flex flex-wrap items-baseline justify-between gap-2">
|
||||
<h2>{{ type.plural }}</h2>
|
||||
<div class="flex gap-2">
|
||||
{{ _self.opener(
|
||||
path('app_admin_resource_type_notifications', { type: type.value }),
|
||||
section.recipients > 0 ? 'Benachrichtigungen (' ~ section.recipients ~ ')' : 'Benachrichtigungen'
|
||||
) }}
|
||||
{{ _self.opener(path('app_admin_resource_group_new', { type: type.value }), type.groupLabel ~ ' hinzufügen') }}
|
||||
{{ _self.opener(path('app_admin_resource_new', { type: type.value }), type.label ~ ' hinzufügen', 'primary') }}
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
{% extends 'email/layout.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
{% set resource = booking.resource %}
|
||||
<h1>Neue Buchung</h1>
|
||||
|
||||
<p>
|
||||
<strong>{{ resource.type.label }} {{ resource.label }}</strong> wurde gebucht.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Datum: {{ booking.date|format_datetime(pattern: 'EEEE, d. MMMM y') }}
|
||||
<br>
|
||||
Zeit: {{ booking.timeRange }}
|
||||
{% if resource.group %}
|
||||
<br>
|
||||
{{ resource.type.groupLabel }}: {{ resource.group.label }}
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Gebucht von {{ booking.user.name }}
|
||||
<br>
|
||||
{{ booking.user.email }}
|
||||
</p>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,14 @@
|
||||
{#
|
||||
Plain text on purpose: a notification is three facts and a name, and a text part renders the
|
||||
same everywhere without a stylesheet anybody has to maintain.
|
||||
#}
|
||||
{% set resource = booking.resource -%}
|
||||
{{ resource.type.label }} {{ resource.label }} wurde gebucht.
|
||||
|
||||
Datum: {{ booking.date|format_datetime(pattern: 'EEEE, d. MMMM y') }}
|
||||
Zeit: {{ booking.timeRange }}
|
||||
{% if resource.group %}{{ resource.type.groupLabel }}:{{ ' ' }}{{ resource.group.label }}
|
||||
{% endif %}Gebucht von: {{ booking.user.name }} ({{ booking.user.email }})
|
||||
|
||||
--
|
||||
E&P Platz
|
||||
@@ -0,0 +1,279 @@
|
||||
{#
|
||||
The MyE&P mail layout, adopted so a mail from Platz looks like every other mail from E&P.
|
||||
Kept as the exported MJML output it is over there -- table scaffolding, Outlook conditionals
|
||||
and all -- so a fix made on either side ports across as a diff rather than a rewrite. Edit the
|
||||
MJML source in myep and re-export rather than hand-patching the tables here.
|
||||
|
||||
Blocks: `body`. Type scale comes from the <style> above: h1, h2, p, p.small, a.button.
|
||||
#}
|
||||
<!doctype html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
|
||||
|
||||
<head>
|
||||
<title>E&P Platz</title>
|
||||
<!--[if !mso]><!-->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<!--<![endif]-->
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type="text/css">
|
||||
#outlook a {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
-ms-text-size-adjust: 100%;
|
||||
}
|
||||
|
||||
table,
|
||||
td {
|
||||
border-collapse: collapse;
|
||||
mso-table-lspace: 0pt;
|
||||
mso-table-rspace: 0pt;
|
||||
}
|
||||
|
||||
img {
|
||||
border: 0;
|
||||
height: auto;
|
||||
line-height: 100%;
|
||||
outline: none;
|
||||
text-decoration: none;
|
||||
-ms-interpolation-mode: bicubic;
|
||||
}
|
||||
|
||||
p {
|
||||
display: block;
|
||||
margin: 13px 0;
|
||||
}
|
||||
|
||||
</style>
|
||||
<!--[if mso]>
|
||||
<noscript>
|
||||
<xml>
|
||||
<o:OfficeDocumentSettings>
|
||||
<o:AllowPNG/>
|
||||
<o:PixelsPerInch>96</o:PixelsPerInch>
|
||||
</o:OfficeDocumentSettings>
|
||||
</xml>
|
||||
</noscript>
|
||||
<![endif]-->
|
||||
<!--[if lte mso 11]>
|
||||
<style type="text/css">
|
||||
.mj-outlook-group-fix { width:100% !important; }
|
||||
</style>
|
||||
<![endif]-->
|
||||
<!--[if !mso]><!-->
|
||||
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap" rel="stylesheet" type="text/css">
|
||||
<style type="text/css">
|
||||
@import url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap);
|
||||
|
||||
</style>
|
||||
<!--<![endif]-->
|
||||
<style type="text/css">
|
||||
@media only screen and (min-width:480px) {
|
||||
.mj-column-per-100 {
|
||||
width: 100% !important;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.mj-column-per-50 {
|
||||
width: 50% !important;
|
||||
max-width: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
<style media="screen and (min-width:480px)">
|
||||
.moz-text-html .mj-column-per-100 {
|
||||
width: 100% !important;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.moz-text-html .mj-column-per-50 {
|
||||
width: 50% !important;
|
||||
max-width: 50%;
|
||||
}
|
||||
|
||||
</style>
|
||||
<style type="text/css">
|
||||
@media only screen and (max-width:479px) {
|
||||
table.mj-full-width-mobile {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
td.mj-full-width-mobile {
|
||||
width: auto !important;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
<style type="text/css">
|
||||
h1 {
|
||||
font-weight: bold;
|
||||
font-size: 24px;
|
||||
line-height: 28px;
|
||||
margin-bottom: 0;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-weight: normal;
|
||||
font-size: 20px;
|
||||
line-height: 24px;
|
||||
margin-bottom: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 16px;
|
||||
padding-bottom: 16px;
|
||||
}
|
||||
|
||||
p.small {
|
||||
font-size: 14px;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: underline;
|
||||
color: #5F7983;
|
||||
}
|
||||
|
||||
a.footerlink {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
a.button {
|
||||
text-decoration: none;
|
||||
color: white;
|
||||
display: inline-block;
|
||||
background-color: #3d8ccb;
|
||||
padding: 8px 16px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body style="word-spacing:normal;background-color:#666666;">
|
||||
<div style="display:none;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;">E&P Platz</div>
|
||||
<div style="background-color:#666666;">
|
||||
<!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:600px;" width="600" ><tr><td style="line-height:0;font-size:0;mso-line-height-rule:exactly;"><v:image style="border:0;mso-position-horizontal:center;position:absolute;top:0;width:600px;z-index:-3;" xmlns:v="urn:schemas-microsoft-com:vml" /><![endif]-->
|
||||
<div style="margin:0 auto;max-width:600px;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;">
|
||||
<tbody>
|
||||
<tr style="vertical-align:top;">
|
||||
<td style="width:0.01%;padding-bottom:NaN%;mso-padding-bottom-alt:0;" />
|
||||
<td style="background:#FFFFFF;background-position:center center;background-repeat:no-repeat;padding:0px;padding-top:10px;padding-bottom:10px;vertical-align:top;">
|
||||
<!--[if mso | IE]><table border="0" cellpadding="0" cellspacing="0" style="width:600px;" width="600" ><tr><td style=""><![endif]-->
|
||||
<div class="mj-hero-content" style="margin:0px auto;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;margin:0px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;margin:0px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-collapse:collapse;border-spacing:0px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width:160px;">
|
||||
<img alt="Logo E&P" src="{{ email.image('@images/logo.png') }}" style="border:0;display:block;outline:none;text-decoration:none;height:auto;width:100%;font-size:13px;" width="160" height="auto" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]></td></tr></table><![endif]-->
|
||||
</td>
|
||||
<td style="width:0.01%;padding-bottom:NaN%;mso-padding-bottom-alt:0;" />
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]></td></tr></table><table align="center" border="0" cellpadding="0" cellspacing="0" class="" role="presentation" style="width:600px;" width="600" bgcolor="#FFFFFF" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->
|
||||
<div style="background:#FFFFFF;background-color:#FFFFFF;margin:0px auto;max-width:600px;">
|
||||
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#FFFFFF;background-color:#FFFFFF;width:100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="border-top:1px solid #3d8ccb;direction:ltr;font-size:0px;padding:20px 0;text-align:center;">
|
||||
<!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" style="vertical-align:top;width:600px;" ><![endif]-->
|
||||
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<div style="font-family:Lato, Verdana, Arial, 'Helvetica neue', sans-serif;font-size:16px;line-height:24px;text-align:left;color:#666666;">{% block body %}{% endblock %}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]></td></tr></table><![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]></td></tr></table><table align="center" border="0" cellpadding="0" cellspacing="0" class="" role="presentation" style="width:600px;" width="600" bgcolor="#3d8ccb" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->
|
||||
<div style="background:#3d8ccb;background-color:#3d8ccb;margin:0px auto;max-width:600px;">
|
||||
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#3d8ccb;background-color:#3d8ccb;width:100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;">
|
||||
<!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" style="vertical-align:top;width:300px;" ><![endif]-->
|
||||
<div class="mj-column-per-50 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<div style="font-family:Lato, Verdana, Arial, 'Helvetica neue', sans-serif;font-size:14px;line-height:18px;text-align:left;color:#FFFFFF;">E&P Reisen und Events GmbH <br /> Aachener Str. 326-328 <br /> 50933 Köln</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]></td><td class="" style="vertical-align:top;width:300px;" ><![endif]-->
|
||||
<div class="mj-column-per-50 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<div style="font-family:Lato, Verdana, Arial, 'Helvetica neue', sans-serif;font-size:14px;line-height:1;text-align:left;color:#FFFFFF;"><a href="https://www.ep-reisen.de/unternehmen/impressum-skireiseveranstalter/" title="E&P Impressum" class="footerlink" target="_blank">Impressum</a>
|
||||
<span>|</span>
|
||||
<a href="https://www.ep-reisen.de/unternehmen/impressum-skireiseveranstalter/datenschutz-winterreisen/" title="E&P Datenschutz" class="footerlink" target="_blank">Datenschutz</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]></td></tr></table><![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]></td></tr></table><![endif]-->
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,37 @@
|
||||
{% extends 'email/layout.html.twig' %}
|
||||
|
||||
{# One mail for the whole series -- see BookingNotifier for why it is not one per occurrence. #}
|
||||
{% block body %}
|
||||
{% set resource = series.resource %}
|
||||
<h1>Neue Serienbuchung</h1>
|
||||
|
||||
<p>
|
||||
<strong>{{ resource.type.label }} {{ resource.label }}</strong> wurde als Serie gebucht.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Zeitraum: {{ series.startDate|format_datetime(pattern: 'd. MMMM y') }}
|
||||
bis {{ series.endDate|format_datetime(pattern: 'd. MMMM y') }}
|
||||
<br>
|
||||
Rhythmus: {{ series.describe }}
|
||||
<br>
|
||||
Termine: {{ result.createdCount }}
|
||||
{% if resource.group %}
|
||||
<br>
|
||||
{{ resource.type.groupLabel }}: {{ resource.group.label }}
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
{% if result.skippedCount > 0 %}
|
||||
<p class="small">
|
||||
{{ result.skippedCount }} Tage waren bereits vergeben und wurden übersprungen:
|
||||
{{ result.skippedDates|join(', ') }}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
<p>
|
||||
Gebucht von {{ series.user.name }}
|
||||
<br>
|
||||
{{ series.user.email }}
|
||||
</p>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,13 @@
|
||||
{# One mail for the whole series -- see BookingNotifier for why it is not one per occurrence. #}
|
||||
{% set resource = series.resource -%}
|
||||
{{ resource.type.label }} {{ resource.label }} wurde als Serie gebucht.
|
||||
|
||||
Zeitraum: {{ series.startDate|format_datetime(pattern: 'd. MMMM y') }} bis {{ series.endDate|format_datetime(pattern: 'd. MMMM y') }}
|
||||
Rhythmus: {{ series.describe }}
|
||||
Termine: {{ result.createdCount }}
|
||||
{% if result.skippedCount > 0 %}Belegt: {{ result.skippedCount }} Tage waren bereits vergeben ({{ result.skippedDates|join(', ') }})
|
||||
{% endif %}{% if resource.group %}{{ resource.type.groupLabel }}:{{ ' ' }}{{ resource.group.label }}
|
||||
{% endif %}Gebucht von: {{ series.user.name }} ({{ series.user.email }})
|
||||
|
||||
--
|
||||
E&P Platz
|
||||
Reference in new issue
Block a user