---
title: Configuring transactional mails
slug: campaign/docs/configuring-transactional-mails
docTags: 
createdAt: 2026-07-20T15:45:20.826Z
---

:::hint{type="info"}
**Note**

This topic is for administrators and developers with administration access rights in Shopware.
:::

This topic describes how to configure sending of transactional mails when using Shopware as e-commerce platform with Optimizely Campaign.

## How it works

Sending of transactional mails uses these templates:

- A **Sender** template in Shopware, which sends the variables of the transaction (for example customer name, ordered products) via the HTTP API.
- A **Recipient** template in Optimizely Campaign, which uses field functions to insert sent variables into relevant locations. This creates the finished transactional mail with layout, and sends it to the recipient.

The sending and receiving of the content of the variables use the transaction recipient list as a buffer.

1. The Shopware template sends the variables.
2. The variables are written into the transaction recipient list: each variable into the relevant recipient list field.
3. Using field functions, Optimizely Campaign copies the template with the individual variables from the transaction recipient list and places it in the desired location in the transactional mail.

   ![Image: Sending and receiving content of variables](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/LzolQmEiXEKxVsYjMhART-20260720-145403.png "Image: Sending and receiving content of variables")

## Configuration steps

1. Set up the [transaction recipient list](docId\:o8JNgomieowXJr-ysCk5u).
2. Configure the [template in Optimizely Campaign](docId\:o8JNgomieowXJr-ysCk5u).
3. Configure the [template in Shopware](docId\:o8JNgomieowXJr-ysCk5u).
4. Configure [the details ](docId\:o8JNgomieowXJr-ysCk5u)of transaction mails.
5. Set up the transactional mails [for multiple shops](docId\:o8JNgomieowXJr-ysCk5u).

### [configuring-transactional-mails.mdx](docId\:o8JNgomieowXJr-ysCk5u)Step 1. Setting up a transaction recipient list

To set up a transaction recipient list, contact [customer support](docId\:ZWe1T3UPz3JW6_4mc76qV). Plan in advance which variables you want to transfer from Shopware into Optimizely Campaign for your transactional mails.

List the Shopware variables for which you require a corresponding recipient list field in your transaction recipient list. Also, let Optimizely know the naming of the recipient list fields.

### [configuring-transactional-mails.mdx](docId\:o8JNgomieowXJr-ysCk5u)Step 2. Creating a template in Optimizely Campaign

Create the template and add the desired transactional mail texts (the unchangeable, static texts to be sent to recipients) and insert field functions in the places where the content of the Shopware variables should be.

### About field functions

[Field functions](docId\:V9V1TFA5Z2cDQH6hNQy59) are placeholders that refer to a specific recipient list field in your transaction recipient list. The variables and content of the variables sent from Shopware are written into the relevant recipient list fields in your transaction recipient list. The field functions you place load relevant content from the referenced recipient list field in the next step.

[configuring-transactional-mails.mdx](docId\:o8JNgomieowXJr-ysCk5u)**Example**

Set up a transactional mail text that greets each customer using the last name and the order date. For this you need these variables: **salutation**, **lastname** and **orderdate**.

The content of the variables is first written to a relevant recipient list field of the transaction recipient list (from Shopware via the HTTP API). To access these recipient list fields, insert the individual field functions into the Optimizely Campaign template and place the name of the recipient list field in curly brackets. To import the variable contents, the static text and field functions in the Optimizely Campaign template could look like this:

```html
Hello, {salutation} {lastname}! Thank you for your online order from {orderdate}.
```

The example will appear in the sent transactional mail as follows:

*Hello, Mr. Miller!*
*Thank you for your online order from August 3.*

To create the template, do the following:

1. Open the Optimizely Campaign[ menu](docId\:PmNPgvNucBrAG5Rw8f41f) and select **Campaigns** > **Transactional Mails**.
2. Click **Create…**.

   ![Image: Create transactional email](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/aoDx99AR_d9ZX48IAV0q3-20260720-145403.png "Image: Create transactional email")
3. Drag the **Recipients** node from the left action area to the working area on the right.
4. In the **Recipient lists** drop-down list, select your transaction recipient list.

   ![Image: Selecting transaction recipient list](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/RNPaSOtLAWFCMl7eojEUN-20260720-145403.png "Image: Selecting transaction recipient list")

   :::hint{type="info"}
   **Note**

   [Customer support](docId\:ZWe1T3UPz3JW6_4mc76qV) sets up a separate transaction recipient list for you. Be sure you use this transaction recipient list, instead of a regular recipient list. To see if a recipient list is a transactional recipient list, check the column **Transaction API**.
   :::
5. From the left action pane, drag the message node for the desired marketing channel (email, SMS) into the workspace.
6. In the **Name** box, assign a concise name to your transactional mail (such as *Order confirmation*).

   ![Image: Edit confirmation name](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/WXynRaFsSJyiKZ3xCnSsv-20260720-145403.png "Image: Edit confirmation name")
7. In the context menu for the message node, click **Edit Content…**.
8. In the **Template** drop-down list, select the desired template and confirm your selection by clicking **Next**.
9. Configure the template for the transactional mail according to your requirements. Enter a subject and insert the static texts that you want recipients to receive, into the content paragraphs. Insert the relevant field function for the recipient list field of the transaction recipient list into places where variables from the Shopware template should appear (see the previous example in this topic).
10. Click **Close**.
11. Connect the **Recipient** node with the message node.
12. Click **Save and Close**.
13. To activate your transactional mail and to start the sending process, select the mailing in the overview and click **Start**.

### [configuring-transactional-mails.mdx](docId\:o8JNgomieowXJr-ysCk5u)Step 3. Configuring the template in Shopware

Configure a transactional mail template that sends variables to Optimizely Campaign via the HTTP API.

**Prerequisites**

- **Authorization code** for your transaction recipient list in to Optimizely Campaign. To see the authorization code, open the Optimizely Campaign [menu](docId\:PmNPgvNucBrAG5Rw8f41f) and select **Administration** > **API Overview**. Open the **Recipient lists** tab and select the desired transaction recipient list. Click **Manage authorization codes** and copy the authorization code from the list. If no authorization code is available for the selected recipient list, click **Create authorization code.**
- The **mailing ID** for the template in Optimizely Campaign. To see the mailing ID, open the Optimizely Campaign [menu](docId\:PmNPgvNucBrAG5Rw8f41f) and select **Campaigns** > **Transactional mails**. Copy the relevant mailing ID of the template in the list in column **ID**.

The Shopware integration contains two functional templates for demonstration purposes:

- sREGISTERCONFIRMATION
- sORDER

:::hint{type="info"}
**Note**

Do *not* use the system template **sOPTINNEWSLETTER**, which is included in the Shopware standard, to set up the newsletter registration. If you do, newsletter registration with Optimizely Campaign will not work.
:::

1. Log in to the back-end of your Shopware system with administrator rights.
2. Go to **Configuration** > **Email templates**.

   ![Image: Email templates menu item](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/bQrPPxbP18bfdkTlh86AA-20260720-145403.png "Image: Email templates menu item")
3. Go through the directory structure to the template that you want to configure.

   ![Image: Select template](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/Dzz-VeeejGSDxioOAA0_V-20260720-145403.png "Image: Select template")
4. To send the template variables to Optimizely Campaign via the HTTP API, select optivo broadmail ("Send with optivo broadmail").

   ![Image: Select template variable](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/r10f19NhoLuy6EXEecv_B-20260720-145403.png "Image: Select template variable")
5. In the **optivo authcode** box, enter the authorization code of your transaction recipient list in Optimizely Campaign.

   ![Image: Enter authcode](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/9R-L_UGJd9h5k3sUDbqq3-20260720-145403.png "Image: Enter authcode")
6. In the **optivo bmMailingId** box, enter the mailing ID of the template in Optimizely Campaign.

   ![Image: Enter mailing ID](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/O2ZluMhRtJppMgciL_hxa-20260720-145403.png "Image: Enter mailing ID")
7. Open the optivo broadmail tab.

   ![Image: optivo broadmail tab](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/h5crZdWytTNyaabQ_vQrH-20260720-145403.png "Image: optivo broadmail tab")

   :::hint{type="info"}
   **Note**

   If the mailing is activated via Optimizely Campaign, the field values in the tabs **Plaintext**, **HTML-Text**, and **Attachments** are ignored.
   :::
8. In the fields of the optivo broadmail tab, map the Shopware variables with the corresponding recipient list fields in your transaction recipient list to Optimizely Campaign. To see available variables for the respective template, click **Sample variables**.

   ![Image: View variable information 1](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/RnYmvKYb3ZlDDsTbpxvZ5-20260720-145404.png "Image: View variable information 1")

   ![Image: View variable information 2](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/WHbJTeMnma7Ts7gUmwnls-20260720-145404.png "Image: View variable information 2")

:::Paragraph{indent="1"}
**Mapping ("Assigning")**
The Shopware integration from Optimizely Campaign uses the following structure for mapping:
:::

```html
Name of the recipient list field=name of the Shopware variable
```

:::Paragraph{indent="1"}
Enter the mapping assignment for each variable line-by-line, and end each line with a semicolon. Separate the individual variables/mapping assignments with line breaks.
**Example:**
:::

```html
salutation={salutation};firstname={firstname};	lastname={lastname};	smail={sMAIL};	shopname={config name=shopName};
```

:::Paragraph{indent="1"}
Use the example lines to map and transfer:
:::

:::Paragraph{listStyleType="disc" indent="2"}
Shopware variable value  to transaction recipient list field `salutation`
:::

:::Paragraph{listStyleType="disc" indent="2"}
Shopware variable value  to transaction recipient list field `firstname`
:::

:::Paragraph{listStyleType="disc" indent="2"}
Shopware variable value  to transaction recipient list field `lastname`
:::

:::Paragraph{listStyleType="disc" indent="2"}
Shopware variable value  to transaction recipient list field `smail`
:::

:::Paragraph{listStyleType="disc" indent="2"}
Shopware variable value \{config name=shopName} to transaction recipient list field `shopname`
:::

:::hint{type="info" indent="2"}
**Note**

Make sure that you map the Shopware variables to be transmitted to existing recipient list fields. Contact [customer support](docId\:ZWe1T3UPz3JW6_4mc76qV) to set these up. Determine in advance which data/content to transfer to Optimizely Campaign, and which content you can implement as static text in the Optimizely Campaign template.
:::

9. Click **Save template**.

### [configuring-transactional-mails.mdx](docId\:o8JNgomieowXJr-ysCk5u)Step 4. Configuring transactional mails

The language template in Shopware writes the ordered products **as a character string** to the recipient list field **orderPositions** in the transaction recipient list. In the template **sORDER**, which contains the Shopware integration by default, you will find the following line next to the standard customer data:

```html
orderPositions={foreach item=details key=position from=$sOrderDetails}  "{$details.ordernumber}"{literal};{/literal}   "{$details.quantity}"{literal};{/literal}   "{$details.price} EUR"{literal};{/literal}   "{$details.amount} EUR"{literal};{/literal}   "{$details.articlename}"{literal};{/literal}{/foreach};
```

The **foreach loop** summarizes ordered products in a character string in CSV format. The individual columns (order number, quantity, price, total price, and article name) are separated by semicolons. The individual products are separated by line break characters.

### Adjusting the for each loop

1. Go to **Configuration** > **Email templates**.
2. Go to the supplied template **sORDER** in the **System emails** directory of the Shopware integration.
3. Open the optivo broadmail tab.
4. Make changes in the mapping instruction line for the recipient list field **orderPositions**. For example, replace **EUR** with another currency, such as **USD**.

   :::hint{type="info"}
   **Note**

   If you have good knowledge of Shopware template features, you can also use these functions to configure data to be transmitted. Observe the correct masking of special characters when making adjustments. In addition, the masking of the separator (semicolon) with  must be retained within the loop.
   :::
5. Click **Save template**.

### Creating a field function for ordered products

To use the ordered products that are transmitted as a character string in a transactional mail, you need a specific field function in your client. This must use the template engine from Optimizely Campaign to transfer the character string to HTML, and to display ordered products in a table inside the transactional mail.

1. Open the Optimizely Campaign [menu](docId\:PmNPgvNucBrAG5Rw8f41f) and select **Administration** > **Field Functions**.

   :::hint{type="info"}
   **Tip**

   If **Field functions** is not available in your client, contact [customer support](docId\:ZWe1T3UPz3JW6_4mc76qV) to enable this feature.
   :::
2. Click **Create…**.

   ![Image: Add field function](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/VFe8-umoLeQBDX1ux5JkM-20260720-145404.png "Image: Add field function")
3. Under **General**, in the **Name** field, enter a name for the new field function, such as *CSVOrderObjects*.

   ![Image: Enter field function name](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/6Vo70wEastVy39mh7RRZ3-20260720-145404.png "Image: Enter field function name")
4. In the **Type** drop-down list, select **Velocity**.
5. In the **Default replacement** tab in the **Content** area, enter the following code in the **Default replacement** field.

```html
<table>    <tr>        <td>Product ID</td><td>SKU</td><td>Name</td><td>Quantity</td>        <td>Price</td>    </tr>#set ($csvContent = $csv.readFromString($user.data.orderpositions))#foreach($row in $csvContent)    <tr>#foreach($item in $row)        <td> $item </td>#end    </tr>#end</table>
```

::Image[]{src="https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/eCA-_a_328w8Xo3KtJ-ov-20260720-145404.png" size="100" isUploading="false" showCaption="false" indent="2"}

6. Click **Save**.

   :::hint{type="info"}
   **Note**

   If you have HTML knowledge, you can customize the layout of the table. See [Field functions](docId\:V9V1TFA5Z2cDQH6hNQy59).
   :::

### [configuring-transactional-mails.mdx](docId\:o8JNgomieowXJr-ysCk5u)Step 5. Setting up transactional mails for multiple shops

If you have additional sub-shops in different languages in Shopware, you can set up individual templates in multiple languages to send transaction mails. You may need separate transaction recipient lists, contact Optimizely [customer support](docId\:ZWe1T3UPz3JW6_4mc76qV) in advance.

You may for example want to set the registration confirmation language for your newsletter to *English* for non-German-speaking recipients. Insert the English translation into the template, and use the corresponding field functions created for the English-speaking customers, in the places where the content of the variables provided by Shopware is to be used. If you do not have any field functions for international parameters in your client, contact [customer support](docId\:ZWe1T3UPz3JW6_4mc76qV).

1. Configure an individual template for transactional mails in Optimizely Campaign as described in [Create a template in Optimizely Campaign](docId\:o8JNgomieowXJr-ysCk5u).
2. Log in to the back end of Shopware using administrator rights.
3. Go to **Configuration** > **Email templates**.
4. To find the desired template, go through the list on the left.
5. In the text box, click the globe icon.
6. Select the sub-shop or the language version for the shop from the menu bar on the left.
7. In the optivo **authcode** box, enter the authorization code for the corresponding transaction recipient list in Optimizely Campaign.
8. In the optivo **bmMailingId** box, enter the mailing ID of the individual template you want to use in Optimizely Campaign.
9. Click **Save translations**.
