n8n-nodes-mailchimp-cmdesign 0.3.0 → 0.3.1
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.
@@ -3,14 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createUpdateSubscriber = void 0;
|
4
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
5
5
|
async function createUpdateSubscriber(apiUrl, apiKey) {
|
6
|
-
var _a
|
6
|
+
var _a;
|
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
10
|
const mergeFields = {};
|
11
11
|
if (((_a = mapping === null || mapping === void 0 ? void 0 : mapping.subscriberFields) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
12
12
|
for (const field of mapping.subscriberFields) {
|
13
|
-
|
13
|
+
const value = this.evaluateExpression(field.subscriberIncomingKey, 0);
|
14
|
+
mergeFields[field.mailChimpField] = String(value !== null && value !== void 0 ? value : '');
|
14
15
|
}
|
15
16
|
}
|
16
17
|
const body = {
|