UNPKG

n8n-nodes-base

Version:

Base nodes of n8n

62 lines (56 loc) 2.23 kB
/** * Email Trigger (IMAP) Node - Version 2.1 * Triggers the workflow when a new email is received */ export interface EmailReadImapV21Params { mailbox?: string | Expression<string> | PlaceholderValue; /** * What to do after the email has been received. If "nothing" gets selected it will be processed multiple times. * @default read */ postProcessAction?: 'read' | 'nothing' | Expression<string>; /** * Whether attachments of emails should be downloaded. Only set if needed as it increases processing. * @displayOptions.show { format: ["simple"] } * @default false */ downloadAttachments?: boolean | Expression<boolean>; /** * The format to return the message in * @default simple */ format?: 'raw' | 'resolved' | 'simple' | Expression<string>; /** * Prefix for name of the binary property to which to write the attachments. An index starting with 0 will be added. So if name is "attachment_" the first attachment is saved to "attachment_0" * @displayOptions.show { format: ["resolved", "simple"], downloadAttachments: [true] } * @default attachment_ */ dataPropertyAttachmentsPrefixName?: string | Expression<string> | PlaceholderValue; options?: { /** Custom email fetching rules. See &lt;a href="https://github.com/mscdex/node-imap"&gt;node-imap&lt;/a&gt;'s search function for more details. * @default ["UNSEEN"] */ customEmailConfig?: string | Expression<string> | PlaceholderValue; /** Sets an interval (in minutes) to force a reconnection * @default 60 */ forceReconnect?: number | Expression<number>; /** Whether to fetch only new emails since the last run, or all emails that match the "Custom Email Rules" (["UNSEEN"] by default) * @default true */ trackLastMessageId?: boolean | Expression<boolean>; }; } export interface EmailReadImapV21Credentials { imap: CredentialReference; } interface EmailReadImapV21NodeBase { type: 'n8n-nodes-base.emailReadImap'; version: 2.1; credentials?: EmailReadImapV21Credentials; isTrigger: true; } export type EmailReadImapV21ParamsNode = EmailReadImapV21NodeBase & { config: NodeConfig<EmailReadImapV21Params>; }; export type EmailReadImapV21Node = EmailReadImapV21ParamsNode;