# Flow Builder & E-Mail Templates

The Stock Reminder plugin fully integrates with the Shopware Flow Builder. This allows you to individually control the email delivery for notifications and confirmations and combine them with existing workflows.

## Available Events

The plugin provides two custom business events that can be used as triggers in the Flow Builder:

### `prems_stock_reminder.subscription.confirm`

This event is triggered when a visitor submits the notification form and the double opt-in feature is enabled. It contains the data needed for the confirmation email, including the confirmation link.

**Typical flow:** Send an email with the confirmation link to the subscriber.

### `prems_stock_reminder.subscription.notification`

This event is triggered when a product is back in stock and the notification email should be sent to the subscriber. It contains the product data and subscription information.

**Typical flow:** Send an email to the subscriber with the product information and a link to the product.

## Setting Up Email Templates

The email templates are automatically created during plugin installation and linked to the corresponding events in the Flow Builder. You can customize the templates at any time via **Settings > Email Templates**.

The following variables are available in the templates for both events:

* Subscription data (email, quantity, confirmation link)
* Product data (name, product number, description)
* Sales channel data


---

# Agent Instructions: 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/back-in-stock-notification/flow-builder-and-e-mail-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.
