מייל מגיע לתיבת דואר
Trigger
mailbox-emailמתחיל כשמגיע מייל חדש לתיבת דואר שחיברתם דרך IMAP, למשל Exchange או תיבת דואר של החברה.
במבט אחד
| מאפיין | ערך |
|---|---|
| Trigger name | mailbox-email |
| Resource | ClusterTrigger (lumen.ai/v1alpha1) |
| Source | event |
| Needs a connection | yes, one that provides mailbox |
| Produces | email, file |
| Emits | item |
| Installation must provide | nothing |
A flow using this trigger names a Connector in connectorRef. Connection types that provide mailbox: [Mailbox (IMAP)](/reference/connections/imap-mailbox), [Microsoft 365](/reference/connections/microsoft-365).
The trigger goes under spec.triggers of a Flow. Its outputs are referenced as <triggerId>.<field>. A trigger can also carry a when condition ("Start only when") and disabled: true.
פלט
צומת מאוחר יותר מפנה לפלט כ-{nodeId.field} בטקסט, או כ-nodeId.field בתנאי.
| פלט | סוג |
|---|---|
from | string |
to | string |
subject | string |
body | string |
attachments | number |
senderVerified | boolean |
receivedAt | date |
messageId | string |
הגדרות
Set under config: on the flow trigger.
| הגדרה | סוג | ברירת מחדל | תיאור |
|---|---|---|---|
folder | string | "INBOX" | Folder is the mailbox folder to watch; unset is INBOX.maxLength 255 |
filters | object | - | Filters keep only the mail that matches; leave them out to take everything. |
filters.fromContains | string | - | Sender containsmaxLength 200 |
filters.subjectContains | string | - | Subject containsmaxLength 200 |
afterHandling | object | - | AfterHandling says what happens to a mail the flow took. |
afterHandling.mode | string | "markRead" | Thenone of markRead, moveTo, leave |
afterHandling.folder | string | - | Folder is where moveTo puts the mail.maxLength 255 |
pollMinutes | integer | 5 | PollMinutes is how often the mailbox is looked at.minimum 1; maximum 60 |
includeAttachments | boolean | true | IncludeAttachments takes the mail's files along; unset is true. |
requireAttachment | boolean | false | RequireAttachment drops mail that carries no file; unset is false, so a mailbox trigger saved before the setting takes every mail as it did. |
maxSizeMB | integer | 25 | MaxSizeMB refuses a mail bigger than this; unset is 25.minimum 1; maximum 40 |
importExisting | integer | 0 | Takes the newest N mails in the folder, before the filters, once when the folder is first read. More than 50 are worked off over several checks.minimum 0; maximum 500 |
attachments | string | - | Each attachment separately: every file goes through the flow on its own, with the email's sender, subject and body, so reply and forward steps answer once per file. The whole email as one: all the files travel together as one document. A trigger saved before this setting existed works as the whole email as one.one of separate, together |
includeInline | boolean | false | Include images in the email body |
ה-JSON Schema המלא של ההגדרות: mailbox-email.schema.json.
שימוש בתהליך
flow.yaml
apiVersion: lumen.ai/v1alpha1
kind: Connector
metadata:
name: my-imap-mailbox
namespace: tenant-acme
spec:
classRef: {name: imap-mailbox}
config: {}
---
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
name: mailbox-email-example
namespace: tenant-acme
spec:
displayName: "An email arrives in a mailbox"
triggers:
- id: start
ref: {name: mailbox-email}
connectorRef: {name: my-imap-mailbox}
next: [notify-in-app]
nodes:
- id: notify-in-app
stepRef: {name: notify-in-app}
config:
body: 'Total: {total}'
title: New invoice from {supplier}
to: admins
הדף עזר לכם?