Skip to content

Commit

Permalink
Extracted common parts of the emails into its seperate template include
Browse files Browse the repository at this point in the history
  • Loading branch information
jbtronics committed Oct 26, 2024
1 parent a3f8895 commit 0871143
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 168 deletions.
79 changes: 0 additions & 79 deletions src/MessageHandler/PaymentOrderDeletedNotificationHandler.php

This file was deleted.

21 changes: 21 additions & 0 deletions templates/mails/_payment_order_table.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<callout class="secondary">
<row>
<columns>
<p>
<b>{% trans %}payment_order.notification_user.department{% endtrans %}: </b> {{ payment_order.department.name }}
</p>
<p>
<b>{% trans %}payment_order.notification_user.project_name{% endtrans %}: </b> {{ payment_order.projectName }}
</p>
<p>
<b>{% trans %}payment_order.notification_user.amount{% endtrans %}: </b> {{ payment_order.amountString }} €
</p>
<p>
<b>{% trans %}payment_order.notification_user.datetime{% endtrans %}</b> {{ payment_order.creationDate | format_datetime }}
</p>
<p>
<b>{% trans %}payment_order.notification_user.id{% endtrans %}: </b> {{ payment_order.iDString }}
</p>
</columns>
</row>
</callout>
22 changes: 1 addition & 21 deletions templates/mails/confirmation.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,7 @@
<br><br>
<p>{% trans with {'%fsb_email%': payment_order.department.fsr ? fsb_email : hhv_email} %}payment_order.confirmation_mail.info{% endtrans %}</p>

<callout class="secondary">
<row>
<columns>
<p>
<b>{% trans %}payment_order.notification_user.department{% endtrans %}: </b> {{ payment_order.department.name }}
</p>
<p>
<b>{% trans %}payment_order.notification_user.project_name{% endtrans %}: </b> {{ payment_order.projectName }}
</p>
<p>
<b>{% trans %}payment_order.notification_user.amount{% endtrans %}: </b> {{ payment_order.amountString }} €
</p>
<p>
<b>{% trans %}payment_order.notification_user.datetime{% endtrans %}</b> {{ payment_order.creationDate | format_datetime }}
</p>
<p>
<b>{% trans %}payment_order.notification_user.id{% endtrans %}: </b> {{ payment_order.iDString }}
</p>
</columns>
</row>
</callout>
{% include "mails/_payment_order_table.html.twig" %}

<p>{% trans %}payment_order.confirmation_email.vpn_hint{% endtrans %}</p>

Expand Down
31 changes: 5 additions & 26 deletions templates/mails/deletion_notification.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,11 @@
<br>
<p>{% trans with {'%fsb_email%': payment_order.department.fsr ? fsb_email : hhv_email} %}payment_order.deletion_email.info{% endtrans %}</p>

<callout class="secondary">
<row>
<columns>
<p>
<b>{% trans %}payment_order.notification_user.department{% endtrans %}: </b> {{ payment_order.department.name }}
</p>
<p>
<b>{% trans %}payment_order.notification_user.project_name{% endtrans %}: </b> {{ payment_order.projectName }}
</p>
<p>
<b>{% trans %}payment_order.notification_user.amount{% endtrans %}: </b> {{ payment_order.amountString }} €
</p>
<p>
<b>{% trans %}payment_order.notification_user.datetime{% endtrans %}</b> {{ payment_order.creationDate | format_datetime }}
</p>
<p>
<b>{% trans %}payment_order.notification_user.id{% endtrans %}: </b> {{ payment_order.iDString }}
</p>
{% if deleted_where == "backend" %}
<p>
<b>{% trans %}payment_order.notification_deletion.blame_user{% endtrans %}: </b> {{ blame_user }} [StuRa]
</p>
{% endif %}
</columns>
</row>
</callout>
{% if deleted_where == "backend" %}
<p>Der Zahlungsauftrag wurde durch eine*n StuRa-Finanzer*in ({{ blame_user }}) gelöscht.</p>
{% endif %}

{% include "mails/_payment_order_table.html.twig" %}

<br>

Expand Down
22 changes: 1 addition & 21 deletions templates/mails/manual_confirmation.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,7 @@
<hr>
<br>

<callout class="secondary">
<row>
<columns>
<p>
<b>{% trans %}payment_order.notification_user.department{% endtrans %}: </b> {{ payment_order.department.name }}
</p>
<p>
<b>{% trans %}payment_order.notification_user.project_name{% endtrans %}: </b> {{ payment_order.projectName }}
</p>
<p>
<b>{% trans %}payment_order.notification_user.amount{% endtrans %}: </b> {{ payment_order.amountString }} €
</p>
<p>
<b>{% trans %}payment_order.notification_user.datetime{% endtrans %}</b> {{ payment_order.creationDate | format_datetime }}
</p>
<p>
<b>{% trans %}payment_order.notification_user.id{% endtrans %}: </b> {{ payment_order.iDString}}
</p>
</columns>
</row>
</callout>
{% include "mails/_payment_order_table.html.twig" %}

<br>

Expand Down
22 changes: 1 addition & 21 deletions templates/mails/user_notification.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,7 @@
<br>
<p>{% trans with {'%fsb_email%': payment_order.department.fsr ? fsb_email : hhv_email } %}payment_order.notification_user.info{% endtrans %}</p>

<callout class="secondary">
<row>
<columns>
<p>
<b>{% trans %}payment_order.notification_user.department{% endtrans %}: </b> {{ payment_order.department.name }}
</p>
<p>
<b>{% trans %}payment_order.notification_user.project_name{% endtrans %}: </b> {{ payment_order.projectName }}
</p>
<p>
<b>{% trans %}payment_order.notification_user.amount{% endtrans %}: </b> {{ payment_order.amountString }} €
</p>
<p>
<b>{% trans %}payment_order.notification_user.datetime{% endtrans %}</b> {{ payment_order.creationDate | format_datetime }}
</p>
<p>
<b>{% trans %}payment_order.notification_user.id{% endtrans %}: </b> {{ payment_order.iDString}}
</p>
</columns>
</row>
</callout>
{% include "mails/_payment_order_table.html.twig" %}

<p>{% trans with {'%fsb_email%': payment_order.department.fsr ? fsb_email : hhv_email } %}payment_order.notification_user.why{% endtrans %}</p>

Expand Down

0 comments on commit 0871143

Please sign in to comment.