# 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 %}
1
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 %}
1
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 %}
1
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 %}
1
2
3
4
5
6
7
8
9
10
11
12
13