> For the complete documentation index, see [llms.txt](https://docs.premsoft.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.premsoft.de/en/plugins/form-toolkit/email-and-flow-builder.md).

# Email and flow builder

Every submission can trigger two different emails:

1. an **internal notification** (via mail route)
2. a **confirmation to the customer** (via Flow Builder action)

## Internal notification — mail routes

Mail routes live in the form editor under **Email**. A route describes a single delivery recipient.

### Fields of a route

| Field         | Meaning                                                                          |
| ------------- | -------------------------------------------------------------------------------- |
| Route name    | Internal label                                                                   |
| Active        | Enable / disable the route                                                       |
| Mail template | Optional; otherwise the default "Form Toolkit – New Submission" template is used |
| Recipient     | Primary recipient (required)                                                     |
| CC            | Optional, comma-separated (Premium)                                              |
| BCC           | Optional, comma-separated (Premium)                                              |
| Conditions    | AND-combined filters, e.g. "send only when Dropdown = Service" (Premium)         |

### Conditional routing (Premium)

In the Premium plan you can attach any number of routes to a form and assign conditions per route. Example:

* Route 1: "Service" → `support@`, condition Dropdown = `Service`
* Route 2: "Sales" → `sales@`, condition Dropdown = `Sales`
* Route 3: "Other" → `info@`, no condition

Evaluation runs per submission — a matching route fires its mail, a non-matching one stays silent.

## Customer confirmation mail

In the form's **General** tab toggle **Send confirmation mail to customer**.

Pick:

* the **mail template** (type "Form Toolkit – Customer Confirmation") — Shopware imports it during plugin activation
* the **form field** that carries the customer address (usually the email field)

Delivery runs as a Flow Builder action — reusable inside your own flows.

## Flow Builder integration

When the plugin is activated a new event **Form was submitted** is registered in the Flow Builder. You can build your own flows on top of it — e.g.:

* trigger a Slack notification
* tag the customer
* notify an external API

### Bundled Flow Builder action

| Action                                     | Effect                                                                             |
| ------------------------------------------ | ---------------------------------------------------------------------------------- |
| **Send customer confirmation (PremsForm)** | Sends the configured confirmation mail to the customer address from the submission |

The installer also creates a default flow that triggers this action on the "Form was submitted" event. You can disable that flow or add your own.

## Multilingual mails

Mail templates are translatable like every other Shopware mail template. The submission's language is used to pick the matching translation — customers get the confirmation in their language.

## Mail template variables

The mail templates expose, among others:

* `form` — the form entity (name, fields, …)
* `entry` — the submission (data, status, language, sales channel)
* `entry.data` — list of every submitted field with `label`, `value` and `fieldType`

Use them to build, for example, a full submission table inside the mail.


---

# 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.premsoft.de/en/plugins/form-toolkit/email-and-flow-builder.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.
