> 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/workflows.md).

# Workflows

This chapter describes how the Huebert Dropshipping Plugin interacts with the order process and what happens in the background.

***

## Overview: Full process flow

```
Customer places an order
        ↓
Order is saved in Shopware
        ↓
Plugin marks the order as "contains dropshipping items"
        ↓
┌──────────────────────────────────────────────────┐
│  Option: Send immediately on order placement?     │
│  (sendMailOnOrderHasBeenPlaced = active)          │
└──────────────────────────────────────────────────┘
        ↓ YES                   ↓ NO
Send email immediately     Wait for trigger status
        ↓                       ↓
                    Status changes to trigger status
                        (e.g. "Paid")
                                ↓
              Has an email already been sent
              for this order?
              ↓ YES                    ↓ NO
     Abort (or resend            Group line items
     if configured)              by supplier
                                         ↓
                          For each supplier:
                          - Generate CSV or XML
                          - Create DHL label (optional)
                          - Prepare and send email
```

***

## Workflow 1: Email on order placement

**Configuration:** Plugin settings > "Send email on order placement" = active

In this workflow the supplier email is sent **immediately** after the order is placed, regardless of payment status.

**Typical use cases:**

* Shops with prepayment where the supplier should be informed immediately
* Systems where payment processing happens externally
* Orders on account (invoice)

> **Caution:** In this workflow, payment has not yet been confirmed. The supplier receives the order even if the customer does not pay later.

***

## Workflow 2: Email after status change (recommended)

**Configuration:** Plugin settings > Trigger status = e.g. "Paid"

This is the **standard workflow**. The email is only sent once the order reaches the configured status.

**Process:**

1. Customer places an order
2. Customer pays (or status is set manually)
3. Payment status changes to "Paid"
4. Plugin detects the trigger and sends the emails

**Advantages:**

* Email only sent on confirmed payment
* No supplier notification for cancelled orders

***

## Workflow 3: Two trigger statuses

**Configuration:** Additional trigger status in the plugin settings

You can configure **two different trigger statuses**. This is useful when different payment providers set different statuses (e.g. "Authorized" for PayPal and "Paid" for bank transfer).

***

## Workflow 4: Resend email

**Configuration:** "Resend email on trigger" = active

By default, the supplier email is sent **only once** per order. With this option enabled, the email is resent every time the trigger status is set.

**Use case:** When an order is cancelled and then reactivated.

***

## How line items are grouped

The plugin analyses all positions in an order and groups them by supplier:

```
Order #10042
├── Product A  → Supplier "Sample GmbH"
├── Product B  → Supplier "Sample GmbH"
├── Product C  → Manufacturer "Brand XY"
└── Product D  → no dropshipping
```

Result: Two emails are sent:

* **Email 1** to "Sample GmbH" with products A and B
* **Email 2** to the email contact of "Brand XY" with product C
* Product D is ignored

***

## Duplicate protection

The plugin stores in the order whether a dropshipping email has already been sent. This prevents duplicate emails even if the trigger status is set multiple times.

This behavior can be overridden with the **"Resend email on trigger"** option.

***

## "No email if in stock"

**Configuration:** Plugin settings > "No email if in stock" = active

With this option, the plugin does **not send an email** to the supplier if the product was still in stock at the time of the order. This is useful if you ship stock items yourself and only fall back to dropshipping when stock runs out.

***

## Summary of key configuration options

| Option                | Description                | Recommendation             |
| --------------------- | -------------------------- | -------------------------- |
| Trigger status = Paid | Standard workflow          | Yes, for most shops        |
| Immediate send        | Email on order placement   | Only for special scenarios |
| Two trigger statuses  | Multiple payment providers | When needed                |
| Resend email          | Resend on trigger          | Use with caution           |
| No email if in stock  | Only when stock runs out   | Optional                   |


---

# 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/workflows.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.
