דלג לתוכן הראשי

מייל מגיע לתיבת דואר

Triggermailbox-email

מתחיל כשמגיע מייל חדש לתיבת דואר שחיברתם דרך IMAP, למשל Exchange או תיבת דואר של החברה.

במבט אחד​

מאפייןערך
Trigger namemailbox-email
ResourceClusterTrigger (lumen.ai/v1alpha1)
Sourceevent
Needs a connectionyes, one that provides mailbox
Producesemail, file
Emitsitem
Installation must providenothing

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 בתנאי.

פלטסוג
fromstring
tostring
subjectstring
bodystring
attachmentsnumber
senderVerifiedboolean
receivedAtdate
messageIdstring

הגדרות​

Set under config: on the flow trigger.

הגדרהסוגברירת מחדלתיאור
folderstring"INBOX"Folder is the mailbox folder to watch; unset is INBOX.maxLength 255
filtersobject-Filters keep only the mail that matches; leave them out to take everything.
filters.fromContainsstring-Sender containsmaxLength 200
filters.subjectContainsstring-Subject containsmaxLength 200
afterHandlingobject-AfterHandling says what happens to a mail the flow took.
afterHandling.modestring"markRead"Thenone of markRead, moveTo, leave
afterHandling.folderstring-Folder is where moveTo puts the mail.maxLength 255
pollMinutesinteger5PollMinutes is how often the mailbox is looked at.minimum 1; maximum 60
includeAttachmentsbooleantrueIncludeAttachments takes the mail's files along; unset is true.
requireAttachmentbooleanfalseRequireAttachment drops mail that carries no file; unset is false, so a mailbox trigger saved before the setting takes every mail as it did.
maxSizeMBinteger25MaxSizeMB refuses a mail bigger than this; unset is 25.minimum 1; maximum 40
importExistinginteger0Takes 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
attachmentsstring-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
includeInlinebooleanfalseInclude 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