# Reply to the email

> Replies in the same thread to the email that started the run, with files attached if you choose.

Source: https://docs.go-lumen.ai/reference/steps/reply-to-email

## At a glance

| Property | Value |
| --- | --- |
| **Step name** | `reply-to-email` |
| **Resource** | ClusterStep (`lumen.ai/v1alpha1`) |
| **Palette group, category** | notify, messages |
| **Credits** | **1** credit each time it succeeds |
| **Side effects** | yes: It changes something outside Lumen, so a retry asks first and a test shows what it would do instead of doing it. |
| **Installation must provide** | `mail` |

## Inputs

| Property | Value |
| --- | --- |
| **Needs** | `email` |
| **Produces** | nothing |
| **Works on** | item: one document at a time |

Needs and Produces are data types (file, text, fields, email). The editor offers a step only where what it needs is already on the path. See [Documents and data](https://docs.go-lumen.ai/concepts/how-flows-run.md#documents-and-data).

## Outputs

No named outputs. Later nodes still see everything produced earlier on the path, and this step passes the documents on unchanged.

## Settings

Set under `config:` on the flow node. Text settings may contain `{nodeId.field}` placeholders.

| Setting | Type | Default | Description |
| --- | --- | --- | --- |
| `body` (required) | string |  | Body is the reply, one paragraph per line. (minLength 1; maxLength 4000) |
| `attach` | string | `"none"` | Attach says which files go with the reply: none, the files the run holds, or only those named in Files. (one of none, run, chosen) |
| `files` | list of string |  | Files names the files to attach when Attach is chosen. (maxItems 20) |
| `replyAll` | boolean |  | ReplyAll also writes to everyone else the original was sent to. |

The full JSON Schema of these settings: [reply-to-email.schema.json](https://docs.go-lumen.ai/schemas/steps/reply-to-email.schema.json).

## Example

Answer a quote request

```yaml title="config"
attach: none
body: שלום, תודה על פנייתך. נחזור אליך עם הצעת מחיר עד סוף היום.
```

## Use it in a flow

A node that runs `reply-to-email` goes under `spec.nodes` of a [Flow](https://docs.go-lumen.ai/concepts/how-flows-run.md#the-flow-as-yaml). Give it any id, and list the next node ids in next.

```yaml title="flow.yaml"
apiVersion: lumen.ai/v1alpha1
kind: Connector
metadata:
  name: my-email-forward
  namespace: tenant-acme
spec:
  classRef: {name: email-forward}
  config: {}
---
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
  name: reply-to-email-example
  namespace: tenant-acme
spec:
  displayName: "Reply to the email"
  triggers:
    - id: start
      ref: {name: email-arrives}
      connectorRef: {name: my-email-forward}
      next: [reply-to-email]
  nodes:
    - id: reply-to-email
      stepRef: {name: reply-to-email}
      config:
        attach: none
        body: שלום, תודה על פנייתך. נחזור אליך עם הצעת מחיר עד סוף היום.
```
