From b9e52117355d939e77a2e3c59a7f67ac21e31b22 Mon Sep 17 00:00:00 2001 From: Marten Steketee Date: Tue, 27 Jun 2023 17:22:39 +0200 Subject: [PATCH] fix(Sendy Node): Fix issue with brand id not being sent (#6530) --- packages/nodes-base/nodes/Sendy/Sendy.node.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/nodes-base/nodes/Sendy/Sendy.node.ts b/packages/nodes-base/nodes/Sendy/Sendy.node.ts index fb5865f5a4..3bb2055a6c 100644 --- a/packages/nodes-base/nodes/Sendy/Sendy.node.ts +++ b/packages/nodes-base/nodes/Sendy/Sendy.node.ts @@ -86,6 +86,11 @@ export class Sendy implements INodeType { const additionalFields = this.getNodeParameter('additionalFields', i); + let brandId = null; + if (!sendCampaign) { + brandId = this.getNodeParameter('brandId', i) as string; + } + const body: IDataObject = { from_name: fromName, from_email: fromEmail, @@ -96,6 +101,10 @@ export class Sendy implements INodeType { html_text: htmlText, }; + if (brandId) { + body.brand_id = brandId as string; + } + if (additionalFields.plainText) { body.plain_text = additionalFields.plainText; } @@ -116,10 +125,6 @@ export class Sendy implements INodeType { body.exclude_segments_ids = additionalFields.excludeSegmentIds as string; } - if (additionalFields.brandId) { - body.brand_id = additionalFields.brandId as string; - } - if (additionalFields.queryString) { body.query_string = additionalFields.queryString as string; }