> For the complete documentation index, see [llms.txt](https://docs.hubyte.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hubyte.de/dropshipping-bestellung-an-lieferanten-herstelle/english-documentation/email-templates.md).

# Email templates

The plugin ships with several email templates that can be customized in the Shopware administration.

***

## Available templates

After installing the plugin, the following email templates are available:

### 1. Dropshipping Partner Delivery Note v2 (recommended)

* **Technical name:** `huebert_dropshipping_sw6_dropshipping_partner_v2`
* **Usage:** Default template for supplier notifications
* **Selection in plugin configuration:** "Dropshipping Partner Delivery Note v2"

### 2. Dropshipping Partner Delivery Note (legacy)

* **Technical name:** `huebert_dropshipping_sw6_dropshipping_partner`
* **Usage:** Older version, for compatibility with existing customizations

### 3. Dropshipping Partner Delivery Note mpXgastronomy

* **Technical name:** `huebert_dropshipping_sw6_dropshipping_partner_mpx`
* **Usage:** Specifically for shops using the mpXgastronomy plugin

### 4. Dropshipping Customer Delivery Status Note

* **Technical name:** `huebert_dropshipping_sw6_dropshipping_delivery_status`
* **Usage:** Customer-facing notification about the delivery status

***

## Customizing templates

Templates can be found and edited in the administration under:\
**Settings > Content > Email templates**

Search for the technical name or for "Dropshipping".

***

## Available template variables

The following variables are available in all dropshipping email templates:

### Order data (`order`)

| Variable                      | Description             | Example               |
| ----------------------------- | ----------------------- | --------------------- |
| `order.orderNumber`           | Order number            | `10042`               |
| `order.orderDate`             | Order date              | `2024-03-15 14:30:00` |
| `order.price.netPrice`        | Net total price         | `84.03`               |
| `order.price.totalPrice`      | Gross total price       | `100.00`              |
| `order.price.calculatedTaxes` | Tax information (array) | –                     |
| `order.lineItems`             | All order line items    | –                     |

### Customer data (`customer`)

| Variable                  | Description     |
| ------------------------- | --------------- |
| `customer.firstName`      | First name      |
| `customer.lastName`       | Last name       |
| `customer.email`          | Email address   |
| `customer.customerNumber` | Customer number |

### Delivery note data (`deliveryNote`)

The `deliveryNote` object contains the line items relevant for this specific supplier. Use `deliveryNote.items` in a loop to access each position.

#### Product data per line item (`item`)

| Variable                         | Description                               | Example             |
| -------------------------------- | ----------------------------------------- | ------------------- |
| `item.label`                     | Product name                              | `"T-Shirt Blue XL"` |
| `item.quantity`                  | Quantity                                  | `2`                 |
| `item.productNumber`             | Shopware product number                   | `"SW10042"`         |
| `item.productManufacturerNumber` | Manufacturer number                       | `"MNR-001"`         |
| `item.variant`                   | Variant information (array)               | –                   |
| `item.purchaseNetPrice`          | Purchase price (net)                      | `84.03`             |
| `item.supplier.translated.name`  | Supplier name                             | `"Supplier Ltd"`    |
| `item.cover.url`                 | URL of the product cover image (optional) | –                   |

#### Product cover image in the email

Since not every product has a cover image, a check should be performed before output:

```twig
{% for item in deliveryNote.items %}
  {% if item.cover is defined and item.cover is not null %}
    <img src="{{ item.cover.url }}" width="75" height="auto" />
  {% endif %}
{% endfor %}
```

> For information on using the supplier name in the storefront (product page, cart, checkout, documents), see [Using the supplier in the storefront](/dropshipping-bestellung-an-lieferanten-herstelle/english-documentation/supplier-in-storefront.md).

***

## Order confirmation email: Additional variables

The following variables are available in the **standard Shopware order confirmation email** and can be used for custom modifications.

### Separate house number field (DHL integration)

When the DHL plugin uses a separate house number field, it can be output in the order confirmation as follows:

**Shipping address:**

```twig
{% if shippingOrderAddress.customFields and shippingOrderAddress.customFields.dhl_address_street_number %}
  {{ shippingOrderAddress.customFields.dhl_address_street_number }}
{% endif %}
```

**Billing address:**

```twig
{% if billingAddress.customFields and billingAddress.customFields.dhl_address_street_number %}
  {{ billingAddress.customFields.dhl_address_street_number }}
{% endif %}
```

### Manufacturer number and quantity of a line item

Using the index `n` (zero-based), individual order positions can be accessed:

| Variable                                                              | Description                     |
| --------------------------------------------------------------------- | ------------------------------- |
| `{{ order.lineItems.at(n).payload.manufacturerNumber\|default('') }}` | Manufacturer number of the item |
| `{{ order.lineItems.at(n).quantity }}`                                | Ordered quantity of the item    |

Example for the first line item (index `0`):

```twig
{{ order.lineItems.at(0).payload.manufacturerNumber|default('') }}
{{ order.lineItems.at(0).quantity }}
```

***

## Example: Simple email template

### Subject

```twig
New dropshipping order #{{ order.orderNumber }}
```

### HTML content

```html
Dear Sir or Madam,<br><br>please find below the delivery note for order {{ order.orderNumber }}. Please confirm shipment by email.<br>
<br>
<table style="border: 1px solid black; border-spacing: 15px;">
    <tr>
        <th>Product number</th>
        <th>Manufacturer number</th>
        <th>Description</th>
        <th>Quantity</th>
    </tr>
    {% if deliveryNote is defined and deliveryNote.items is defined %}
    {% for item in deliveryNote.items %}
    <tr>
        <td>{{ item.productNumber }}</td>
        <td>{{ item.productManufacturerNumber }}</td>
        <td>{{ item.label }}
        {% if item.variant|length > 0 %}
        <br> - {{ item.variant|join(" - ") }}
        {% endif %}
        </td>
        <td>{{ item.quantity }}</td>
    </tr>
    {% endfor %}
    {% endif %}
</table>
<br>
Shipping address:<br>
   {% if order.deliveries is defined %}
{% for item in order.deliveries %}
{{ item.shippingOrderAddress.title }} {{ item.shippingOrderAddress.firstName }} {{ item.shippingOrderAddress.lastName }}<br>
{{ item.shippingOrderAddress.street }} {% if streetNumberActivated and item.shippingOrderAddress.customFields and item.shippingOrderAddress.customFields.dhl_address_street_number %}{{ item.shippingOrderAddress.customFields.dhl_address_street_number }}{% endif %}<br>
{{ item.shippingOrderAddress.zipcode }} {{ item.shippingOrderAddress.city }}<br>
{{ item.shippingOrderAddress.country.name }}<br>
<br>
{% endfor %}
{% endif %}
Shipping method: {{ order.deliveries|first.shippingMethod.name }}<br>
Payment method: {{ order.transactions|first.paymentMethod.name }}
```

***

## Selecting a template

In the **plugin settings** you can define which template is used for all supplier notifications:

**Settings > Plugins > Huebert Dropshipping > Email template**

Select the desired template from the dropdown list.

***

## Multilingual support

Email templates can be customized separately for each language. Shopware automatically sends the email in the language of the sales channel associated with the order.

***

## Important notes

* Always test template changes in test mode first to verify the output
* The **test mode** in the plugin settings redirects all emails to a test address
* The "v2" template is the recommended current version
* After plugin updates, customized templates should be reviewed for new variables


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hubyte.de/dropshipping-bestellung-an-lieferanten-herstelle/english-documentation/email-templates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
