fix(Sendy Node): Fix issue with brand id not being sent (#6530)

This commit is contained in:
Marten Steketee 2023-06-27 17:22:39 +02:00 committed by GitHub
parent 5b5f30fd33
commit 2e8dfb86d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}