diff --git a/packages/nodes-base/nodes/EmailReadImap.node.ts b/packages/nodes-base/nodes/EmailReadImap.node.ts index 9ef58802e7..9c01ff5b53 100644 --- a/packages/nodes-base/nodes/EmailReadImap.node.ts +++ b/packages/nodes-base/nodes/EmailReadImap.node.ts @@ -69,7 +69,7 @@ export class EmailReadImap implements INodeType { displayOptions: { show: { downloadAttachments: [ - 'true' + true ], }, }, @@ -90,7 +90,6 @@ export class EmailReadImap implements INodeType { } const mailbox = this.getNodeParameter('mailbox') as string; - const dataPropertyAttachmentsPrefixName = this.getNodeParameter('dataPropertyAttachmentsPrefixName') as string; const postProcessAction = this.getNodeParameter('postProcessAction') as string; const downloadAttachments = this.getNodeParameter('downloadAttachments') as boolean; @@ -160,6 +159,11 @@ export class EmailReadImap implements INodeType { let attachments: IBinaryData[]; let propertyName: string; + let dataPropertyAttachmentsPrefixName = ''; + if (downloadAttachments === true) { + dataPropertyAttachmentsPrefixName = this.getNodeParameter('dataPropertyAttachmentsPrefixName') as string; + } + // All properties get by default moved to metadata except the ones // which are defined here which get set on the top level. const topLevelProperties = [