# E-Mail Templates

## Ausgabe von Bestellinformationen

Im Standard-Mailtemplate von Shopware werden bereits alle Bestellinformationen ausgegeben. Diese können nach belieben angepasst werden, sodass mehr oder weniger Informationen übermittelt werden.

### Ausgabe von bestimmten Feld-Werten im Template

```twig
{% set breite = nestedItem.payload.options|filter(option => option.group == "Breite") %}
Ihre gewählte Breite: {{ breite.option|raw }}

```

### Ausgabe von HTML-Code in Labels

Falls HTML-Code in Feld-Labels oder Werten genutzt wird, muss das Standard-Template angepasst werden:

**Suchen nach:**

```twig
{% for option in nestedItem.payload.options %}
   {{ option.group }}: {{ option.option }}
   {% if nestedItem.payload.options|last != option %}
     {{ " | " }}
   {% endif %}
{% endfor %}
```

**Ersetzen durch:**

```twig
{% for option in nestedItem.payload.options %}
   {{ option.group|raw }}: {{ option.option|raw }}
   {% if nestedItem.payload.options|last != option %}
     {{ " | " }}
   {% endif %}
{% endfor %}
```

Durch **|raw** wird der HTML-Code umgewandelt.

### Ausgabe von Dateiupload-Links

Um Links aus Dateiuploads direkt in Mailtemplates auszugeben ist folgender Code notwendig:

**Suchen nach:**

```twig
{% for option in nestedItem.payload.options %}
   {{ option.group }}: {{ option.option }}
   {% if nestedItem.payload.options|last != option %}
     {{ " | " }}
   {% endif %}
{% endfor %}
```

**Ersetzen durch:**

```twig
{% for option in nestedItem.payload.options %}
    {{ option.group }}:
    {% if option.configurator and option.configurator.field_type == 'multiUpload' and option.configurator.user_value.files is defined %}
        {% for file in option.configurator.user_value.files %}
            <a target="_blank" href="{{file.url}}">{{file.name}}</a>
        {% endfor %}
    {% else %}
        {{ option.option }}
    {% endif %}
    {% if nestedItem.payload.options|last != option %}{{ " | " }}{% endif %}
{% endfor %}
```

### Ausgabe von dynamischem Produktbild

Bei aktiver Option "Dynamisches Produktbild speichern" steht das dynamische Produktbild auch in E-Mails zur Verfügung.

**Suchen nach (ca. Zeile 35):**

```twig
<td>{% if nestedItem.cover is defined and nestedItem.cover is not null %}<img src="{{ nestedItem.cover.url }}" width="75" height="auto"/>{% endif %}</td>
```

**Ersetzen durch:**

```twig
<td>
{% if lineItem.payload.neon_configurator.images.dynamicImage %}
    <img src="{{ lineItem.payload.neon_configurator.images.dynamicImage }}" class="img-fluid line-item-img" alt="" title="" loading="lazy">
{% else %}
    {% if nestedItem.cover is defined and nestedItem.cover is not null %}
        <img src="{{ nestedItem.cover.url }}" width="75" height="auto"/>
    {% endif %}
{% endif %}
</td>


```


---

# 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.neonlines.de/artikel-konfigurator/weitere-funktionen/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.
