Fix and improvements on Sendy-Node

This commit is contained in:
Jan Oberhauser 2020-10-13 10:48:46 +02:00
parent 6098384a30
commit 844d257c25
4 changed files with 33 additions and 25 deletions

View file

@ -46,7 +46,7 @@ export const campaignFields = [
}, },
}, },
default: '', default: '',
description: `The 'From name' of your campaign`, description: `The 'From name' of your campaign.`,
}, },
{ {
displayName: 'From Email', displayName: 'From Email',
@ -63,7 +63,7 @@ export const campaignFields = [
}, },
}, },
default: '', default: '',
description: `The 'From email' of your campaign`, description: `The 'From email' of your campaign.`,
}, },
{ {
displayName: 'Reply To', displayName: 'Reply To',
@ -80,7 +80,7 @@ export const campaignFields = [
}, },
}, },
default: '', default: '',
description: `The 'Reply to' of your campaign`, description: `The 'Reply to' of your campaign.`,
}, },
{ {
displayName: 'Title', displayName: 'Title',
@ -97,7 +97,7 @@ export const campaignFields = [
}, },
}, },
default: '', default: '',
description: `The 'Title' of your campaign`, description: `The 'Title' of your campaign.`,
}, },
{ {
displayName: 'Subject', displayName: 'Subject',
@ -114,7 +114,7 @@ export const campaignFields = [
}, },
}, },
default: '', default: '',
description: `The 'Subject' of your campaign`, description: `The 'Subject' of your campaign.`,
}, },
{ {
displayName: 'HTML Text', displayName: 'HTML Text',
@ -131,6 +131,7 @@ export const campaignFields = [
}, },
}, },
default: '', default: '',
description: `The 'HTML version' of your campaign.`,
}, },
{ {
displayName: 'Send Campaign', displayName: 'Send Campaign',
@ -149,6 +150,26 @@ export const campaignFields = [
default: false, default: false,
description: `Set to true if you want to send the campaign as well and not just create a draft. Default is false.`, description: `Set to true if you want to send the campaign as well and not just create a draft. Default is false.`,
}, },
{
displayName: 'Brand ID',
name: 'brandId',
type: 'string',
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'campaign',
],
sendCampaign: [
false,
],
},
},
required: true,
default: '',
},
{ {
displayName: 'Additional Fields', displayName: 'Additional Fields',
name: 'additionalFields', name: 'additionalFields',
@ -166,19 +187,6 @@ export const campaignFields = [
}, },
}, },
options: [ options: [
{
displayName: 'Brand ID',
name: 'brandId',
type: 'string',
displayOptions: {
show: {
'/sendCampaign': [
false,
],
},
},
default: '',
},
{ {
displayName: 'Exclude List IDs', displayName: 'Exclude List IDs',
name: 'excludeListIds', name: 'excludeListIds',
@ -198,21 +206,21 @@ export const campaignFields = [
name: 'listIds', name: 'listIds',
type: 'string', type: 'string',
default: '', default: '',
description: `List IDs should be single or comma-separated`, description: `List IDs should be single or comma-separated.`,
}, },
{ {
displayName: 'Plain Text', displayName: 'Plain Text',
name: 'plainText', name: 'plainText',
type: 'string', type: 'string',
default: '', default: '',
description: `The 'Plain text version' of your campaign` description: `The 'Plain text version' of your campaign.`
}, },
{ {
displayName: 'Querystring', displayName: 'Querystring',
name: 'queryString', name: 'queryString',
type: 'string', type: 'string',
default: '', default: '',
description: `Google Analytics tags`, description: `Google Analytics tags.`,
}, },
{ {
displayName: 'Segment IDs', displayName: 'Segment IDs',

View file

@ -104,7 +104,7 @@ export class Sendy implements INodeType {
reply_to: replyTo, reply_to: replyTo,
title, title,
subject, subject,
send_campaign: sendCampaign, send_campaign: sendCampaign ? 1 : 0,
html_text: htmlText, html_text: htmlText,
}; };
@ -137,11 +137,11 @@ export class Sendy implements INodeType {
} }
if (additionalFields.trackOpens) { if (additionalFields.trackOpens) {
body.track_opens = additionalFields.trackOpens as boolean; body.track_opens = additionalFields.trackOpens as boolean ? 1 : 0;
} }
if (additionalFields.trackClicks) { if (additionalFields.trackClicks) {
body.track_clicks = additionalFields.trackClicks as boolean; body.track_clicks = additionalFields.trackClicks as boolean ? 1 : 0;
} }
responseData = await sendyApiRequest.call( responseData = await sendyApiRequest.call(

View file

@ -111,7 +111,7 @@ export const subscriberFields = [
description: `User's 2 letter country code`, description: `User's 2 letter country code`,
}, },
{ {
displayName: 'GDRP', displayName: 'GDPR',
name: 'gdpr', name: 'gdpr',
type: 'boolean', type: 'boolean',
default: false, default: false,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB