X-Sitter sends some emails by itself, for example the login details of a new employee or the link to reset a forgotten password. Under **Company Settings › Email Templates** (*Firmen Einstellungen › E-Mail-Vorlagen*) you decide what these **system emails** look like for your company. You take over a template from the X-Sitter **email library** and adapt subject, sender name and text. As long as you have no own template, X-Sitter sends its standard email.

![Screenshot: Email templates overview with the system emails, their subject, the language badges, the status and the buttons preview and Apply](/company/images/mail-templates-overview.png)

!!! System emails or workflow emails?
This page is only about the system emails. The emails your **workflows** send (shipping confirmations, order confirmations, internal notifications) are maintained under **WMS › Settings › Email Templates** – see [Email templates for workflows](/automation/email-templates.md).

| | System emails (this page) | Workflow emails |
|---|---|---|
| Menu | **Company Settings › Email Templates** | **WMS › Settings › Email Templates** |
| Sent when | X-Sitter itself sends the email, e.g. when a user is created or a password is reset | A workflow runs the action **Send Email** |
| Without own template | The X-Sitter standard email is sent | You always create the template yourself – from scratch or from the library |
| Languages | One text per language | One text |
!!!

## Before you start

- Your user needs the permission **Email Templates** (*E-Mail-Vorlagen*) in the area **Settings (company)** (*Einstellungen (Firma)*) of the permissions tree. Ask your administrator.
- Sender address, logo and footer of the emails are not set here, but under **Administration › Settings › Email - sending** – see [Company settings](/administration/settings.md). Without your own SMTP server, X-Sitter sends the emails, and your address is the reply-to address.

## Which emails are there?

The list shows every system email the email library offers. Currently these are:

| Email | When X-Sitter sends it |
|---|---|
| **Zugangsdaten Benutzer** (user login details) | After a user has been created or the password of a user has been changed, e.g. under [Employees](/company/employees.md). |
| **Passwort vergessen (Link)** (forgot password – link) | When a user clicks **Forgot password?** on the login page. The email contains the link to reset the password. |
| **Übergangspasswort** (temporary password) | After the user has confirmed the reset link. The email contains a temporary password. |

Your templates apply to the users of your company. As a logistician they also apply to the users of your clients, as long as a client has no own template for the same email.

### Columns of the overview

| Column | Meaning |
|---|---|
| **Email** (*Mail*) | Name and short description of the system email. |
| **Subject** (*Betreff*) | Subject of your own template – or of the library version, if you have no own template. |
| **Languages** (*Sprachen*) | One badge per language: green = own template, yellow = own template, newer library text available, light = X-Sitter standard text, grey outline = no text in this language (the German email is sent). Click a badge to open the template in this language. |
| **Status** | **Default** (*Standard*) = no own template, the X-Sitter standard email is sent. **Own template · v1** (*Eigene Vorlage*) = your copy and the library version it is based on. **New version available (v1 → v2)** (*Neue Version verfügbar*) = X-Sitter has published a new version. **Own template** in blue = an own template that does not come from the library. |

## Step by step

### 1. Take over an email from the library

1. Open **Company Settings › Email Templates** (*Firmen Einstellungen › E-Mail-Vorlagen*).
2. Optional: click the eye icon (**Preview of the library version**, *Vorschau der Bibliotheks-Version*) to see the standard text with sample data.
3. Click **Apply** (*Übernehmen*). X-Sitter asks **Adopt template?** (*Vorlage übernehmen?*) – "The email will then be sent using your template. You can customize it afterward."
4. Confirm with **Apply**. You see "The template was adopted and now applies to your company." (*Die Vorlage wurde übernommen und gilt ab sofort für Deine Firma.*) and the editor opens.

X-Sitter copies the German text **and** every translation the library has – you get one own template per language.

![Screenshot: Dialog "Adopt template?" with the buttons Apply and Cancel](/company/images/mail-templates-adopt.png)

### 2. Adapt the template

1. In the overview click the edit icon of the email – or a language badge.
2. Choose the language at the top. The tabs show a flag and the language name, plus an icon:
   - warning triangle – a newer version of the text is available,
   - book – no own template, the standard text of this language applies,
   - plus – no text yet, the German text applies.
3. Change the **Template Name** (*Name der Vorlage*), the **Sender name** (*Absender Name*) and the **Subject** (*Betreff*) as needed.
4. Write the **Email text (HTML / Twig)** (*Mailtext (HTML / Twig)*). It is inserted into the layout of the system emails. Helpers in the toolbar:
   - **Insert a block** (*Baustein einfügen*) – **Logo (X-Sitter Bot)**, **Login link** (*Link zur Anmeldung*), **Button with link** (*Button mit Link*) and **Default footer** (*Standard-Fußzeile*).
   - **Variables** (*Variablen*) – the values of this email and general values, see below. A click inserts the code at the cursor position.
   - **Insert image** (*Bild einfügen*) – a logo or image from the [media management](/company/media.md).
   - **Library version** (*Bibliotheks-Version*) – puts the current library text of this language back into the editor.
5. Check the **Preview** (*Vorschau*) on the right. It uses sample data and refreshes automatically while **Live** is switched on; otherwise click **Refresh Preview** (*Vorschau aktualisieren*).
6. Click **Save** (*Speichern*) – or press Ctrl/Cmd + S. You see "The email template has been saved" (*Die E-Mail-Vorlage wurde gespeichert*).

As long as there are unsaved changes, the title shows the badge **changed** (*geändert*), and your browser warns you before you leave the page.

![Screenshot: Editor of the system email with the language tabs, sender name, subject, mail text, the settings panel and the preview](/company/images/mail-templates-editor.png)

### 3. Add another language

1. Open the template and click the tab of a language without own template.
2. The editor starts with the library text of this language – or, if the library has no text in this language, with your German text. A note above the fields tells you which one.
3. Translate or adapt the text and click **Save**. From now on users of this language get your text.

To remove an own template in one language, open that language and click **Delete this language** (*Diese Sprache löschen*). After the confirmation **Delete own template in this language?** (*Eigene Vorlage in dieser Sprache löschen?*) the X-Sitter standard email applies again in this language. The German template cannot be deleted on its own – it belongs to the template itself.

### 4. Take over a new library version

When X-Sitter publishes a new version of a library email, your template shows **New version available**. You decide:

- **Use new version** (*Neue Version übernehmen*) – after the question **Adopt new version?** (*Neue Version übernehmen?*) the subject and text of your template are replaced by the current library version. Name and sender stay. You see "Version 2 from the library was adopted." (*Version 2 aus der Bibliothek wurde übernommen.*)
- **Keep** (*Behalten*) – your version stays, the notice disappears: "Your version is kept and the notice is hidden." (*Deine Version bleibt, der Hinweis wird ausgeblendet.*)

Both buttons are in the overview and in the editor.

### 5. Back to the standard email

Click the delete icon in the overview. After the question **Delete your own template?** (*Eigene Vorlage löschen?*) your templates of this email are deleted in **all** languages, and X-Sitter sends its standard email again: "Your own template was deleted; the default email applies again."

## Fields and options

| Field | Meaning | Required |
|---|---|---|
| **Template Name** (*Name der Vorlage*) | Your name for the template, at most 32 characters. | yes |
| **Sender name** (*Absender Name*) | Name shown as the sender. The library templates use the sender name from **Administration › Settings**. | no |
| **Subject** (*Betreff*) | Subject line, variables allowed. | yes |
| **Email text (HTML / Twig)** (*Mailtext (HTML / Twig)*) | Content of the email. It is inserted into the layout of the system emails (header with logo, footer). | no |

The sender **address** cannot be changed per template; it always comes from your company settings.

### Variables

The **Variables** panel has two groups:

| Group | Content |
|---|---|
| **Values for this email** (*Werte dieser Mail*) | The values X-Sitter passes when sending this email, e.g. first and last name, user name and password of the user, or the code of the reset link. Each entry shows an example value. Yes/no values are inserted as a condition. |
| **General** (*Allgemein*) | **Portal address** (*Adresse des Portals*), **Email footer** (*Fußzeile der Mails*), **Sender name** (*Absendername*), **Sender address** (*Absenderadresse*) – your own, otherwise the default –, **Company name** (*Name der Firma*, from **Settings › Global**) and **Today's date** (*Heutiges Datum*). |

### Which language does the user get?

For **Passwort vergessen** the language of the login page applies, for all other emails the default language of your company (**Products › Languages**, *Produkte › Sprachen*). If there is no text in this language, the German email is sent.

## Good to know / Troubleshooting

| Message | Cause | Solution |
|---|---|---|
| "Please enter a name for the template" / "Please enter a subject line" (*Bitte gib einen Namen für die Vorlage ein* / *Bitte gib einen Betreff ein*) | Template name or subject is empty. | Fill in both fields and save again. |
| "The template contains errors; the submission would fail: …" (*Die Vorlage enthält Fehler, der Versand würde fehlschlagen: …*) | Syntax error in a variable, condition or loop. The message names the field and the row. The template is saved anyway. | Fix the named place (e.g. missing closing braces) and save again – otherwise the email cannot be sent. |
| *Fehler in der Vorlage: …* (error in the template) | The preview cannot be created because of an error in the text. | Fix the text; the preview refreshes. |
| "The template was not found." (*Die Vorlage wurde nicht gefunden.*) | The template has been deleted in the meantime, e.g. in another browser tab. | Reload the overview. |
| "The company already has its own template for this email." (*Die Firma hat für diese Mail bereits eine eigene Vorlage.*) | You clicked **Apply** although the email has already been taken over. | Reload the overview and edit the existing template. |
| "This template is not available in the library." (*Die Vorlage ist in der Bibliothek nicht verfügbar.*) | X-Sitter has withdrawn the library email. | Your existing templates keep working. Contact X-Sitter support if you need the email. |
