n8n-nodes-mailchimp-cmdesign 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,11 +7,14 @@ async function createUpdateSubscriber(apiUrl, apiKey) {
7
7
  const listId = this.getNodeParameter('listId', 0);
8
8
  const email = this.getNodeParameter('email', 0);
9
9
  const mapping = this.getNodeParameter('subscriberFieldMapping', 0);
10
+ const items = this.getInputData();
10
11
  const mergeFields = {};
11
12
  if (((_a = mapping === null || mapping === void 0 ? void 0 : mapping.subscriberFields) === null || _a === void 0 ? void 0 : _a.length) > 0) {
12
13
  for (const field of mapping.subscriberFields) {
13
- const value = this.evaluateExpression(field.subscriberIncomingKey, 0);
14
- mergeFields[field.mailChimpField] = String(value !== null && value !== void 0 ? value : '');
14
+ const value = items[0].json[field.subscriberIncomingKey];
15
+ if (value !== undefined && value !== null && String(value).trim() !== '') {
16
+ mergeFields[field.mailChimpField] = String(value);
17
+ }
15
18
  }
16
19
  }
17
20
  const body = {
@@ -33,7 +33,7 @@ const subscriberInputs = [
33
33
  },
34
34
  {
35
35
  displayName: 'MailchimpCm Field Name or ID',
36
- name: 'mailAirField',
36
+ name: 'mailChimpField',
37
37
  type: 'options',
38
38
  description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
39
39
  typeOptions: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-mailchimp-cmdesign",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "n8n node to interact with Mailchimp API",
5
5
  "main": "index.js",
6
6
  "scripts": {