# לשלוח לי במייל

> שולח את התוצאה במייל עם הקבצים מצורפים, מייל אחד לאדם אחד או לכמה, ואם צריך גם בעותק ובעותק מוסתר. בנושא ובהודעה אפשר להשתמש בפרטים שנמצאו, ותאריך יכול לקבל תבנית, כמו {email.receivedAt:MM/yyyy} ל 10/2026.

Source: https://docs.go-lumen.ai/he/reference/steps/send-email

## במבט אחד

| מאפיין | ערך |
| --- | --- |
| **שם השלב** | `send-email` |
| **משאב** | ClusterStep (`lumen.ai/v1alpha1`) |
| **קבוצה וקטגוריה** | notify, messages |
| **קרדיטים** | **1** קרדיט בכל פעם שהוא מצליח |
| **השפעה חיצונית** | כן: הוא משנה משהו מחוץ ל-Lumen, ולכן ניסיון חוזר שואל קודם, ובדיקה מראה מה הוא היה עושה במקום לעשות את זה. |
| **ההתקנה צריכה לספק** | `mail` |

## קלט

| מאפיין | ערך |
| --- | --- |
| **צריך** | `file` |
| **מפיק** | כלום |
| **עובד על** | item: מסמך אחד בכל פעם |

״צריך״ ו״מפיק״ הם סוגי נתונים (file, text, fields, email). העורך מציע שלב רק במקום שבו מה שהוא צריך כבר נמצא במסלול. ראו [מסמכים ונתונים](https://docs.go-lumen.ai/he/concepts/how-flows-run.md#documents-and-data).

## פלט

אין פלטים בשם. הצמתים הבאים עדיין רואים את כל מה שהופק קודם במסלול, והשלב מעביר את המסמכים הלאה כמו שהם.

## הגדרות

מגדירים תחת `config:` בצומת של התהליך. הגדרות טקסט יכולות להכיל מצייני מקום כמו `{nodeId.field}`.

| הגדרה | סוג | ברירת מחדל | תיאור |
| --- | --- | --- | --- |
| `to` (חובה) | text or list |  | Send to (minLength 3; maxLength 2000; minItems 1; maxItems 20) |
| `cc` | text or list |  | Cc are copied in, seen by everyone. (maxLength 2000; maxItems 20) |
| `bcc` | text or list |  | Bcc are copied in unseen: the mail server is told, the headers are not. (maxLength 2000; maxItems 20) |
| `subject` | string |  | A custom subject starts a new conversation in Gmail, apart from the email that started the run. Leave it empty to reply in that conversation. A date can be written with a layout: `{mail.receivedAt:MM/yyyy}` gives 10/2026. Layouts use yyyy, yy, MM and dd, and MMM for the month name in English (Oct). (maxLength 200) |
| `body` | string |  | A date can be written with a layout: `{mail.receivedAt:MM/yyyy}` gives 10/2026. Layouts use yyyy, yy, MM and dd, and MMM for the month name in English (Oct). (maxLength 4000) |
| `attach` | boolean | `true` | Attach the run's files; unset is true. |
| `format` | string | `"plain"` | Format is how the email looks. branded is Lumen's designed email: a title, an intro, sections, a button and a footer; the Message may then be Markdown. plain, which a step with no format also is, is the message as lines of text. (one of plain, branded) |
| `title` | string |  | Title is the large heading of a branded email. (maxLength 200) |
| `intro` | string |  | Intro is a short paragraph under the title. (maxLength 1000) |
| `sections` | list of object |  | Sections are headed blocks of a branded email: a paragraph (text), a list (bullets) or label and value lines (details). With none, the Message is read as Markdown into sections. (maxItems 30) |
| `sections[].heading` | string |  |  |
| `sections[].text` | string |  |  |
| `sections[].bullets` | list of string |  |  |
| `sections[].details` | list of object |  |  |
| `sections[].details[].label` (חובה) | string |  |  |
| `sections[].details[].value` (חובה) | string |  |  |
| `button` | object |  | Button is the one primary action of a branded email. |
| `button.text` (חובה) | string |  |  |
| `button.url` (חובה) | string |  |  |
| `footer` | string |  | Footer is a small note under a branded email's content. (maxLength 500) |
| `from` | string |  | The name of a Microsoft 365 connection. Empty sends from Lumen's address. (maxLength 63) |

ה-JSON Schema המלא של ההגדרות: [send-email.schema.json](https://docs.go-lumen.ai/schemas/steps/send-email.schema.json).

## דוגמה

```yaml title="config"
body: Hi, the invoice from {supplier} is attached.
subject: Invoice from {supplier}
to: accounting@yourcompany.co.il
```

## שימוש בתהליך

צומת שמריץ את `send-email` נכנס תחת `spec.nodes` של [Flow](https://docs.go-lumen.ai/he/concepts/how-flows-run.md#the-flow-as-yaml). תנו לו כל מזהה, ורשמו ב-next את מזהי הצמתים הבאים.

```yaml title="flow.yaml"
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
  name: send-email-example
  namespace: tenant-acme
spec:
  displayName: "Send it to me by email"
  triggers:
    - id: start
      ref: {name: manual-run}
      next: [send-email]
  nodes:
    - id: send-email
      stepRef: {name: send-email}
      config:
        body: Hi, the invoice from {supplier} is attached.
        subject: Invoice from {supplier}
        to: accounting@yourcompany.co.il
```
