# Emails

## Template Functions

### LocaHTML *KEY*

Gets *KEY* from loca for the current user's frontend language. Expects the key to be HTML.

### LocaText *KEY*

Gets *KEY* from loca for the current user's frontend language. Expects the key to be regular text.

### LocaData *LocaValue*

Gets the best loca for the current user's database languages. *LocaValue* is a map with localized values.

### LocaFrontend *LocaValue*

Gets the best loca for the current user's frontend language. *LocaValue* is a map with localized values.

## transition\_reject, transition\_resolve

### To

The email is sent to the the transition configured recipient of the email. For groups, the emails of all users in that group are used.

### Attachments

This email attaches the browser thumb for each object being rejected (if available). Currently there is no check whether if the attachment is actually used in the HTML output or not. The attachment is marked as HTML, so if not referenced inside HTML, mail agents may not show the attachment.

### Replacements

Various replacements can be used inside the Email templates when rendering. Available information depends on the context on configuration of the transition and action executed for this email.

| Variable                                         | Description                                                                                                                                              |
| ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `.Action`                                        | Struct containing all information of the curent action.                                                                                                  |
| `.Action.Subject`                                | Confirured subject for the email.                                                                                                                        |
| `.Action.Message`                                | Configured message for the email.                                                                                                                        |
| `.Transition`                                    | Struct containing all information of the current transition.                                                                                             |
| `.Transition.Confirm`                            | Configured onfirmation text.                                                                                                                             |
| `.Info.Objects`                                  | List of objects affected by this transition. Each object has a number of properties accessible for rendering. To output standard info of the object use: |
| `.Info.Objects.#.Standard.One.Text`              | Output the standard 1 textual information.                                                                                                               |
| `.Info.Objects.#.Standard.BrowserThumb.Filename` | Output the filename of the browser thumb as used in the attachments.                                                                                     |


---

# 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.fylr.io/for-developers/emails.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.
