Email Template for Order Confirmation – Cart Upload Pro Shopware 6
Below you will find an example of how to add the uploaded data to the "Order Confirmation" email template.
From version 2.5.0: use
upload.downloadUrlinstead of a hand-built pathDo not assemble the link from the shop path yourself any more – use
{{ upload.downloadUrl }}. The plugin then always returns a link to the file's actual storage location, even if you later switch on private storage.Before
<a href="{{ url('frontend.home.page') }}uploads/final/{{ upload.qquuid }}/{{ upload.fileName }}">{{ upload.fileName }}</a>After
<a href="{{ upload.downloadUrl }}">{{ upload.fileName }}</a>As long as private storage is switched off,
downloadUrlproduces exactly the same public path as before. Making the change is therefore risk-free and can be done at any time.
Insert the following code at the desired location, but within the for loop for the items:
for loop
{% for lineItem in order.nestedLineItems %}Code for outputting the data
{% if lineItem.extensions.uploads %}
<tr>
<td colspan='5'>
Übertragene Daten<br/>
<ul>
{% for upload in lineItem.extensions.uploads %}
<li><a href="{{ upload.downloadUrl }}" class="cart-item-label" target="_blank">{{ upload.fileName }}</a></li>
{% endfor %}
</ul>
</td>
</tr>
{% endif %}Example based on the default Shopware template
<div style="font-family:arial; font-size:12px;">
{% set currencyIsoCode = order.currency.isoCode %}
{% if order.orderCustomer.salutation %}{{ order.orderCustomer.salutation.translated.letterName ~ ' ' }}{% endif %}{{ order.orderCustomer.firstName }} {{ order.orderCustomer.lastName }},<br>
<br>
We have received your order from {{ order.orderDateTime|format_datetime('medium', 'short', locale='en-GB') }}.<br>
<br>
Order number: {{ order.orderNumber }}<br>
<br>
<table border="0" style="font-family:Arial, Helvetica, sans-serif; font-size:12px;">
<tr>
<td bgcolor="#F7F7F2" style="border-bottom:1px solid #cccccc;"><strong>Prod. no.</strong></td>
<td bgcolor="#F7F7F2" style="border-bottom:1px solid #cccccc;"><strong>Description</strong></td>
<td bgcolor="#F7F7F2" style="border-bottom:1px solid #cccccc;"><strong>Quantities</strong></td>
<td bgcolor="#F7F7F2" style="border-bottom:1px solid #cccccc;"><strong>Price</strong></td>
<td bgcolor="#F7F7F2" style="border-bottom:1px solid #cccccc;"><strong>Total</strong></td>
</tr>
{% for lineItem in order.nestedLineItems %}
<tr>
<td>{% if nestedItem.payload.productNumber is defined %}{{ nestedItem.payload.productNumber|u.wordwrap(80) }}{% endif %}</td>
<td>{{ nestedItem.label|u.wordwrap(80) }}</td>
<td style="text-align: center">{{ nestedItem.quantity }}</td>
<td>{{ nestedItem.unitPrice|currency(currencyIsoCode) }}</td>
<td>{{ nestedItem.totalPrice|currency(currencyIsoCode) }}</td>
</tr>
{% if lineItem.extensions.uploads %}
<tr>
<td colspan='5'>
Übertragene Daten<br/>
<ul>
{% for upload in lineItem.extensions.uploads %}
<li><a href="{{ upload.downloadUrl }}" class="cart-item-label" target="_blank">{{ upload.fileName }}</a></li>
{% endfor %}
</ul>
</td>
</tr>
{% endif %}
{% endfor %}
</table>
</div>Was this page helpful?
Support
Rented Plugins (Shopware Store)
For support with plugins rented from the Shopware Store, please open a support ticket in your Shopware account.
Create Shopware Ticket