# Email templates
# Purchase Vouchers
In order to show your customers the voucher code in the mail template after purchasing a voucher, the mail template must be extended.
Under "Settings > Shop > E-Mail Templates" you will find the template "Order confirmation". Here you expand the text and the HTML block with the following scripts.
# Text / Plain
{% if order.extensions and order.extensions.netiEasyCouponPurchaseVouchers is defined %}
{% if order.extensions.netiEasyCouponPurchaseVouchers|length is same as(1) %}Information about the purchased voucher:
{% else %}Information about the purchased vouchers:
{% endif %}
{% if order.extensions.netiEasyCouponPurchaseVouchers|length is same as(1) %}The voucher can only be redeemed after the order has been paid.
Your vouchers can also be found in your account.
{% else %}The vouchers can only be redeemed after the order has been paid.
Your vouchers can also be found in your account.
{% endif %}
{% for purchaseVoucher in order.extensions.netiEasyCouponPurchaseVouchers %}Article: {{ purchaseVoucher.product.translated.name }}
Code: {{ purchaseVoucher.code }}
Value: {{ (purchaseVoucher.value * purchaseVoucher.currencyFactor) | number_format(purchaseVoucher.currency.itemRounding.decimals) }} {{ purchaseVoucher.currency.symbol }}
{% endfor %}
{% endif %}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# HTML
{% if order.extensions and order.extensions.netiEasyCouponPurchaseVouchers is defined %}
{% if order.extensions.netiEasyCouponPurchaseVouchers|length is same as(1) %}
Information about the purchased voucher:<br />
{% else %}
Information about the purchased vouchers:<br />
{% endif %}
<br />
{% if order.extensions.netiEasyCouponPurchaseVouchers|length is same as(1) %}
The voucher can only be redeemed after the order has been paid.<br />
Your vouchers can also be found in your account.<br />
{% else %}
The vouchers can only be redeemed after the order has been paid.<br />
Your vouchers can also be found in your account.<br />
{% endif %}
<br />
{% for purchaseVoucher in order.extensions.netiEasyCouponPurchaseVouchers %}
Article: {{ purchaseVoucher.product.translated.name }}<br />
Code: {{ purchaseVoucher.code }}<br />
Value: {{ (purchaseVoucher.value * purchaseVoucher.currencyFactor) | number_format(purchaseVoucher.currency.itemRounding.decimals) }} {{ purchaseVoucher.currency.symbol }}<br /><br />
{% endfor %}
{% endif %}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Remaining amounts of vouchers
In order to show your customers remaining amounts after redeeming a voucher, the mail template must be extended.
Under "Settings > Shop > E-Mail Templates" you will find the template "Order confirmation". Here you expand the text and the HTML block with the following scripts.
# Text / Plain
{% if order.extensions and order.extensions.netiEasyCouponCashedRestValues is defined %}
Following voucher/s was/were used:
{% for voucher in order.extensions.netiEasyCouponCashedRestValues %}
{% if voucher.discardRemaining or voucher.value <= 0 %}
Code: {{ voucher.code }} hast no rest value.
{% else %}
Code: {{ voucher.code }} with a rest value of {{(voucher.value * order.currencyFactor) |currency(currencyIsoCode)}}.
{% if order.currency.id is not same as(voucher.currencyId) %}
<small>( {{ (voucher.value * voucher.currency.factor) | format_currency(voucher.currency.isoCode, {fraction_digit: voucher.currency.itemRounding.decimals}) }} )</small>
{% endif %}
{% endif %}
{% endfor %}
{% endif %} 2
3
4
5
6
7
8
9
10
11
12
# HTML
{% if order.extensions and order.extensions.netiEasyCouponCashedRestValues is defined %}
Following voucher/s was/were used: <br />
{% for voucher in order.extensions.netiEasyCouponCashedRestValues %}
{% if voucher.discardRemaining or voucher.value <= 0 %}
Code: {{ voucher.code }} has no rest value. <br />
{% else %}
Code: {{ voucher.code }} with a rest value of {{(voucher.value * order.currencyFactor) |currency(currencyIsoCode)}}
{% if order.currency.id is not same as(voucher.currencyId) %}
<small>( {{ (voucher.value * voucher.currency.factor) | format_currency(voucher.currency.isoCode, {fraction_digit: voucher.currency.itemRounding.decimals}) }} )</small>
{% endif %}
.<br>
{% endif %}
{% endfor %}
{% endif %} 2
3
4
5
6
7
8
9
10
11
12
13
# Product vouchers
# Assigned vouchers
From plugin version 5.14.1 (Shopware 6.5) or 6.8.1 (Shopware 6.6), it is possible to include the products to which the voucher is applied or added to the cart in the mail template for the assigned customers.
Under "Settings > Shop > E-Mail Templates" you will find the template "NetiEasyCoupon_AssignedToCustomer". Here you expand the text and the HTML block with the following scripts.
# Text / Plain
{% if
voucher.discount is defined
and voucher.discount.discountProducts is defined
and voucher.discount.considerAdvancedRules is same as(constant('NetInventors\\NetiNextEasyCoupon\\Core\\Content\\Discount\\DiscountEntity::CONSIDER_CHOSEN_PRODUCTS'))
%}
{% if voucher.discount.productCartAdditionEnabled %}
The voucher adds the following products to the cart and only applies to these products:
{% else %}
The voucher can only be applied to these products:
{% endif %}
{% for discountProduct in voucher.discount.discountProducts %}
{% if voucher.discount.productCartAdditionEnabled %}
- {{ discountProduct.quantity }} x - {{ discountProduct.product.productNumber }} - {{ discountProduct.product.name }}
{% else %}
- {{ discountProduct.product.productNumber }} - {{ discountProduct.product.name }}
{% endif %}
{% endfor %}
{% endif %}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# HTML
{% if
voucher.discount is defined
and voucher.discount.discountProducts is defined
and voucher.discount.considerAdvancedRules is same as(constant('NetInventors\\NetiNextEasyCoupon\\Core\\Content\\Discount\\DiscountEntity::CONSIDER_CHOSEN_PRODUCTS'))
%}
<p>
{% if voucher.discount.productCartAdditionEnabled %}
The voucher adds the following products to the cart and only applies to these products:
{% else %}
The voucher will only be applied to these products:
{% endif %}
</p>
<ul>
{% for discountProduct in voucher.discount.discountProducts %}
<li>
{% if voucher.discount.productCartAdditionEnabled %}
{{ discountProduct.quantity }} x -
{% endif %}
{{ discountProduct.product.productNumber }} - {{ discountProduct.product.name }}
</li>
{% endfor %}
</ul>
{% endif %}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Admin transaction to customer
When creating a manual voucher transaction and enabling “Notify customers”, an optional customer comment can be added and displayed in the mail template.
Under "Settings > Shop > E-Mail Templates" you can find the template "NetiEasyCoupon_AdminTransactionToCustomer". Extend both the plain text and HTML content with the following snippets.
# Text / Plain
{% if customerComment %}
Customer comment:
{{ customerComment }}
{% endif %}
2
3
4
# HTML
{% if customerComment %}
<br />
<strong>Customer comment:</strong><br />
{{ customerComment|nl2br }}
<br />
<br />
{% endif %}
2
3
4
5
6
7