n8n-nodes-greentick 0.0.0-stage → 1.0.0
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.
- package/LICENSE +21 -0
- package/README.md +118 -2
- package/dist/credentials/GreenTickApi.credentials.js +39 -0
- package/dist/lib/payload.js +231 -0
- package/dist/nodes/GreenTick/GreenTick.node.js +596 -0
- package/dist/nodes/GreenTick/GreenTickTrigger.node.js +187 -0
- package/dist/nodes/GreenTick/api.js +305 -0
- package/dist/nodes/GreenTick/greentick.svg +4 -0
- package/package.json +44 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 GreenTick
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,119 @@
|
|
|
1
|
-
#
|
|
1
|
+
# GreenTick for n8n
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`n8n-nodes-greentick` is an n8n community node package for [GreenTick](https://greentick.ai), the WhatsApp Business API platform. Send approved WhatsApp templates, manage GreenTick contacts, labels, and attributes, and start workflows from WhatsApp events.
|
|
4
|
+
|
|
5
|
+
The package has two nodes:
|
|
6
|
+
|
|
7
|
+
- **GreenTick**: actions for messages, contacts, labels, and attributes.
|
|
8
|
+
- **GreenTick Trigger**: starts a workflow when a WhatsApp event happens.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
In n8n, go to **Settings → Community Nodes → Install**. Enter `n8n-nodes-greentick` and confirm.
|
|
13
|
+
|
|
14
|
+
For more help, see n8n's [community nodes installation guide](https://docs.n8n.io/integrations/community-nodes/installation/).
|
|
15
|
+
|
|
16
|
+
## Prerequisites
|
|
17
|
+
|
|
18
|
+
- A GreenTick account on a plan that includes the API (Starter, Standard, or Premium).
|
|
19
|
+
- A connected WhatsApp Business account.
|
|
20
|
+
- For **GreenTick Trigger**, n8n must be reachable at a public `https` address. GreenTick only sends webhooks to `https` URLs. When self-hosting, set `N8N_WEBHOOK_URL` (`WEBHOOK_URL` on older n8n versions) to that public address.
|
|
21
|
+
|
|
22
|
+
## Credentials
|
|
23
|
+
|
|
24
|
+
The **GreenTick API** credential uses a Developer API key.
|
|
25
|
+
|
|
26
|
+
1. In GreenTick, open **Developer** and choose the WhatsApp Business account.
|
|
27
|
+
2. Enter a **Key name** and click **Create API key**.
|
|
28
|
+
3. Copy the key. It starts with `gt_live_` and is shown only once.
|
|
29
|
+
4. In n8n, create a **GreenTick API** credential and paste the key. Leave **API Base URL** as `https://api.greentick.ai`.
|
|
30
|
+
|
|
31
|
+
Each key belongs to one WhatsApp Business account. n8n sends it as `Authorization: Bearer gt_live_…`. Saving the credential checks the key against `GET /v1/api-key`.
|
|
32
|
+
|
|
33
|
+
More detail: [GreenTick API authentication](https://docs.greentick.ai/developers/authentication).
|
|
34
|
+
|
|
35
|
+
## GreenTick node
|
|
36
|
+
|
|
37
|
+
| Resource | Operations |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| Message | Send a template |
|
|
40
|
+
| Contact | Create, Update, List |
|
|
41
|
+
| Label | Create, Update, Delete |
|
|
42
|
+
| Attribute | Create, Update, Delete |
|
|
43
|
+
|
|
44
|
+
**Send a template** sends one approved WhatsApp template. It loads your WhatsApp numbers and the approved templates that use named variables. After you pick a template, open **Template Fields** and choose **Add all fields** to list that template's `{{variables}}`. A header URL, button link, or copy code appears only when the template needs it. A template with no variables has no fields.
|
|
45
|
+
|
|
46
|
+
**Create a contact** adds a contact with an optional label and attribute. Choose **No label** or **No attribute** to add none.
|
|
47
|
+
|
|
48
|
+
**Update a contact** asks for the phone number with country code, finds that contact, and sends only the fields you fill in. Blank name and notes stay unchanged. Labels and attributes can be left as they are, removed, or replaced with one choice.
|
|
49
|
+
|
|
50
|
+
**List contacts** returns every contact by default (**Return All**). It fetches 1000 per request until it reaches the total. Turn **Return All** off to get one page of up to 2000 contacts; page `0` is the first page. The label filter is optional; choose **All contacts** to clear it.
|
|
51
|
+
|
|
52
|
+
Results show names, phone numbers, labels, attributes, and a success status. Internal ids are left out.
|
|
53
|
+
|
|
54
|
+
## GreenTick Trigger
|
|
55
|
+
|
|
56
|
+
Activating the workflow registers a webhook in GreenTick. Deactivating it, or changing the selected events, removes that subscription. It appears in GreenTick under **Developer → Webhooks** as `n8n: …`.
|
|
57
|
+
|
|
58
|
+
Events:
|
|
59
|
+
|
|
60
|
+
- New message received (`message.received`)
|
|
61
|
+
- Message sent (`message.sent`)
|
|
62
|
+
- Message delivered (`message.delivered`)
|
|
63
|
+
- Message read (`message.read`)
|
|
64
|
+
- Message failed (`message.failed`)
|
|
65
|
+
- Catalog order received (`order.received`)
|
|
66
|
+
|
|
67
|
+
Select one or more events. **Message types** and **WhatsApp number** are optional filters. Events that don't match are acknowledged and don't start the workflow.
|
|
68
|
+
|
|
69
|
+
Each item includes the event, message type, customer phone, text, live chat link, order items, button or list reply, and status. Image, video, and document events put a live chat link in `text`, because the file itself isn't in the webhook.
|
|
70
|
+
|
|
71
|
+
More detail: [GreenTick webhooks](https://docs.greentick.ai/developers/webhooks).
|
|
72
|
+
|
|
73
|
+
## Example workflows
|
|
74
|
+
|
|
75
|
+
**Log incoming WhatsApp messages to Google Sheets**
|
|
76
|
+
|
|
77
|
+
1. **GreenTick Trigger**: event **New message received**.
|
|
78
|
+
2. **Google Sheets → Append row**: map `customerPhone`, `text`, and `liveChatUrl`.
|
|
79
|
+
|
|
80
|
+
**Welcome new leads on WhatsApp**
|
|
81
|
+
|
|
82
|
+
1. A trigger for your lead source, for example **Typeform Trigger** or **Webhook**.
|
|
83
|
+
2. **GreenTick → Contact → Create**: phone number with country code, first name, and a label such as `lead`.
|
|
84
|
+
3. **GreenTick → Message → Send a template**: pick an approved welcome template and map its variables.
|
|
85
|
+
|
|
86
|
+
**Export a labelled audience**
|
|
87
|
+
|
|
88
|
+
1. **Manual Trigger** or **Schedule Trigger**.
|
|
89
|
+
2. **GreenTick → Contact → List**: choose a label, keep **Return All** on.
|
|
90
|
+
3. **Google Sheets** or **Convert to File** to save the list.
|
|
91
|
+
|
|
92
|
+
Tip: to test an action on its own, start the workflow with **Manual Trigger**. When an action follows **GreenTick Trigger**, running the workflow waits for a real WhatsApp event first.
|
|
93
|
+
|
|
94
|
+
## Compatibility
|
|
95
|
+
|
|
96
|
+
Tested with n8n 2.49.
|
|
97
|
+
|
|
98
|
+
## Resources
|
|
99
|
+
|
|
100
|
+
- [GreenTick website](https://greentick.ai)
|
|
101
|
+
- [GreenTick developer docs](https://docs.greentick.ai/developers/overview)
|
|
102
|
+
- [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)
|
|
103
|
+
|
|
104
|
+
## Support
|
|
105
|
+
|
|
106
|
+
Email [hello@greentick.ai](mailto:hello@greentick.ai) or [open an issue](https://github.com/AkshayAgrawal1997/greentick-n8n/issues).
|
|
107
|
+
|
|
108
|
+
## Development
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
npm install
|
|
112
|
+
npm test
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
To load the package into a local n8n, link it into `~/.n8n/custom`, or set `N8N_CUSTOM_EXTENSIONS` to this directory, then restart n8n.
|
|
116
|
+
|
|
117
|
+
## License
|
|
118
|
+
|
|
119
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
class GreenTickApi {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.name = "greenTickApi";
|
|
4
|
+
this.displayName = "GreenTick API";
|
|
5
|
+
this.documentationUrl = "https://docs.greentick.ai/developers/authentication";
|
|
6
|
+
this.properties = [
|
|
7
|
+
{
|
|
8
|
+
displayName: "API Key",
|
|
9
|
+
name: "apiKey",
|
|
10
|
+
type: "string",
|
|
11
|
+
typeOptions: { password: true },
|
|
12
|
+
default: "",
|
|
13
|
+
required: true,
|
|
14
|
+
description:
|
|
15
|
+
"From GreenTick → Developer. Starts with gt_live_. Each key belongs to one WhatsApp Business account.",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
displayName: "API Base URL",
|
|
19
|
+
name: "baseUrl",
|
|
20
|
+
type: "string",
|
|
21
|
+
default: "https://api.greentick.ai",
|
|
22
|
+
required: true,
|
|
23
|
+
description: "Leave the default for production. Do not include /v1.",
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
this.test = {
|
|
27
|
+
request: {
|
|
28
|
+
baseURL: "={{$credentials.baseUrl.replace(/\\/$/, '')}}",
|
|
29
|
+
url: "/v1/api-key",
|
|
30
|
+
method: "GET",
|
|
31
|
+
headers: {
|
|
32
|
+
Authorization: "=Bearer {{$credentials.apiKey}}",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
module.exports = { GreenTickApi };
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
const MEDIA_TYPES = ["image", "video", "document", "audio", "sticker"];
|
|
2
|
+
const EXTRA_TEMPLATE_FIELDS = [
|
|
3
|
+
"headerMediaUrl",
|
|
4
|
+
"dynamicURLVariable",
|
|
5
|
+
"copyCodeVariable",
|
|
6
|
+
];
|
|
7
|
+
|
|
8
|
+
function liveChatUrl(conversationId) {
|
|
9
|
+
const id = String(conversationId || "").trim();
|
|
10
|
+
if (!id) return "";
|
|
11
|
+
return `https://dashboard.greentick.ai/apps/live-chat?conversationId=${id}`;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function payloadOf(data) {
|
|
15
|
+
const payload = data?.content?.payload;
|
|
16
|
+
return payload && typeof payload === "object" ? payload : {};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function isInternalIdKey(key) {
|
|
20
|
+
const name = String(key || "");
|
|
21
|
+
if (name === "id" || name === "_id" || name === "wamid" || name === "ref") return true;
|
|
22
|
+
if (name === "phoneNumberRef" || name === "signingSecret") return true;
|
|
23
|
+
return /Id$/.test(name) || /_id$/i.test(name);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function withoutIds(value) {
|
|
27
|
+
if (Array.isArray(value)) return value.map(withoutIds);
|
|
28
|
+
if (!value || typeof value !== "object") return value;
|
|
29
|
+
const out = {};
|
|
30
|
+
for (const [key, raw] of Object.entries(value)) {
|
|
31
|
+
if (isInternalIdKey(key)) continue;
|
|
32
|
+
out[key] = withoutIds(raw);
|
|
33
|
+
}
|
|
34
|
+
return out;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function orderText(data) {
|
|
38
|
+
const items = payloadOf(data).product_items;
|
|
39
|
+
if (!Array.isArray(items) || !items.length) return "Catalog order";
|
|
40
|
+
return items
|
|
41
|
+
.map((item) => {
|
|
42
|
+
const name = String(item?.name || item?.title || "item");
|
|
43
|
+
const quantity = item?.quantity;
|
|
44
|
+
return quantity ? `${name} x${quantity}` : name;
|
|
45
|
+
})
|
|
46
|
+
.join(", ");
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function eventText(data) {
|
|
50
|
+
const type = String(data?.type || data?.content?.type || "");
|
|
51
|
+
const payload = payloadOf(data);
|
|
52
|
+
if (type === "text") return String(payload.body || "");
|
|
53
|
+
if (type === "order") return orderText(data);
|
|
54
|
+
if (MEDIA_TYPES.includes(type)) {
|
|
55
|
+
const url = liveChatUrl(data?.conversationId);
|
|
56
|
+
return url ? `View it in GreenTick: ${url}` : "";
|
|
57
|
+
}
|
|
58
|
+
return String(payload.body || payload.caption || payload.text || "");
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function flattenEvent(payload) {
|
|
62
|
+
const body = payload && typeof payload === "object" ? payload : {};
|
|
63
|
+
const data = body.data && typeof body.data === "object" ? body.data : {};
|
|
64
|
+
const content = data.content || null;
|
|
65
|
+
const messagePayload = payloadOf(data);
|
|
66
|
+
const direction = data.direction || null;
|
|
67
|
+
const conversationId = data.conversationId || null;
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
event: body.type || "",
|
|
71
|
+
eventType: body.type || "",
|
|
72
|
+
created: body.created ?? null,
|
|
73
|
+
direction,
|
|
74
|
+
messageType: data.type || content?.type || null,
|
|
75
|
+
customerPhone: direction === "inbound" ? data.from || null : data.to || null,
|
|
76
|
+
from: data.from || null,
|
|
77
|
+
to: data.to || null,
|
|
78
|
+
status: data.status || data.deliveryStatus || null,
|
|
79
|
+
deliveryStatus: data.deliveryStatus || data.status || null,
|
|
80
|
+
timestamp: data.timestamp || null,
|
|
81
|
+
text: eventText(data),
|
|
82
|
+
liveChatUrl: liveChatUrl(conversationId),
|
|
83
|
+
replyTitle:
|
|
84
|
+
messagePayload.button_reply?.title ||
|
|
85
|
+
messagePayload.list_reply?.title ||
|
|
86
|
+
messagePayload.text ||
|
|
87
|
+
null,
|
|
88
|
+
mediaMimeType: messagePayload.mime_type || null,
|
|
89
|
+
fileName: messagePayload.filename || null,
|
|
90
|
+
latitude: messagePayload.latitude ?? null,
|
|
91
|
+
longitude: messagePayload.longitude ?? null,
|
|
92
|
+
locationName: messagePayload.name || null,
|
|
93
|
+
locationAddress: messagePayload.address || null,
|
|
94
|
+
reactionEmoji: messagePayload.emoji || null,
|
|
95
|
+
orderItems: Array.isArray(messagePayload.product_items)
|
|
96
|
+
? withoutIds(messagePayload.product_items)
|
|
97
|
+
: null,
|
|
98
|
+
content: content ? withoutIds(content) : null,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function eventMatches(payload, filters = {}) {
|
|
103
|
+
const body = payload && typeof payload === "object" ? payload : {};
|
|
104
|
+
const data = body.data && typeof body.data === "object" ? body.data : {};
|
|
105
|
+
const events = filters.events || [];
|
|
106
|
+
const messageTypes = filters.messageTypes || [];
|
|
107
|
+
const phoneNumberId = String(filters.phoneNumberId || "").trim();
|
|
108
|
+
|
|
109
|
+
if (events.length && !events.includes(body.type)) return false;
|
|
110
|
+
if (phoneNumberId && String(data.metaPhoneNumberId || "") !== phoneNumberId) {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
if (messageTypes.length) {
|
|
114
|
+
const messageType = String(data.type || data.content?.type || "");
|
|
115
|
+
if (!messageTypes.includes(messageType)) return false;
|
|
116
|
+
}
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function variablesFromCollection(variables) {
|
|
121
|
+
const rows = variables?.variable;
|
|
122
|
+
if (!Array.isArray(rows)) return {};
|
|
123
|
+
const out = {};
|
|
124
|
+
for (const row of rows) {
|
|
125
|
+
const name = String(row?.name || "").trim();
|
|
126
|
+
if (!name) continue;
|
|
127
|
+
const value = row?.value;
|
|
128
|
+
if (value === undefined || value === null || String(value) === "") continue;
|
|
129
|
+
out[name] = String(value);
|
|
130
|
+
}
|
|
131
|
+
return out;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function splitTemplateId(templateId) {
|
|
135
|
+
const value = String(templateId || "");
|
|
136
|
+
const splitAt = value.indexOf("::");
|
|
137
|
+
if (splitAt === -1) {
|
|
138
|
+
return { name: value, language: "" };
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
name: value.slice(0, splitAt),
|
|
142
|
+
language: value.slice(splitAt + 2),
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function templatePieces(input) {
|
|
147
|
+
const mapped = input?.templateFields?.value;
|
|
148
|
+
const extras = {};
|
|
149
|
+
const variables = {};
|
|
150
|
+
|
|
151
|
+
if (mapped && typeof mapped === "object") {
|
|
152
|
+
for (const [key, raw] of Object.entries(mapped)) {
|
|
153
|
+
if (raw === undefined || raw === null || String(raw) === "") continue;
|
|
154
|
+
if (EXTRA_TEMPLATE_FIELDS.includes(key)) extras[key] = String(raw);
|
|
155
|
+
else variables[key] = String(raw);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const legacy = variablesFromCollection(input?.variables);
|
|
160
|
+
return {
|
|
161
|
+
variables: { ...legacy, ...variables },
|
|
162
|
+
headerMediaUrl: extras.headerMediaUrl || input?.headerMediaUrl || "",
|
|
163
|
+
dynamicURLVariable: extras.dynamicURLVariable || input?.dynamicURLVariable || "",
|
|
164
|
+
copyCodeVariable: extras.copyCodeVariable || input?.copyCodeVariable || "",
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function buildTemplateBody(input) {
|
|
169
|
+
const selected = splitTemplateId(input.templateId);
|
|
170
|
+
const pieces = templatePieces(input);
|
|
171
|
+
const template = {
|
|
172
|
+
name: selected.name,
|
|
173
|
+
language: selected.language || String(input.language || ""),
|
|
174
|
+
};
|
|
175
|
+
if (Object.keys(pieces.variables).length) template.variables = pieces.variables;
|
|
176
|
+
if (pieces.headerMediaUrl) template.headerMediaUrl = pieces.headerMediaUrl;
|
|
177
|
+
if (pieces.dynamicURLVariable) {
|
|
178
|
+
template.dynamicURLVariable = pieces.dynamicURLVariable;
|
|
179
|
+
}
|
|
180
|
+
if (pieces.copyCodeVariable) template.copyCodeVariable = pieces.copyCodeVariable;
|
|
181
|
+
return {
|
|
182
|
+
to: input.to,
|
|
183
|
+
type: "template",
|
|
184
|
+
phoneNumberRef: input.phoneNumberRef,
|
|
185
|
+
template,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function filled(value) {
|
|
190
|
+
return value !== undefined && value !== null && String(value).trim() !== "";
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function choiceList(action, selectedId) {
|
|
194
|
+
if (action === "remove") return ["__none__"];
|
|
195
|
+
if (action === "replace" && filled(selectedId)) return [String(selectedId)];
|
|
196
|
+
return undefined;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function contactFields(input, { includePhone }) {
|
|
200
|
+
const body = {};
|
|
201
|
+
if (includePhone && filled(input.phoneNumber)) body.phoneNumber = String(input.phoneNumber).trim();
|
|
202
|
+
if (filled(input.firstName)) body.firstName = String(input.firstName).trim();
|
|
203
|
+
if (filled(input.lastName)) body.lastName = String(input.lastName).trim();
|
|
204
|
+
if (filled(input.notes)) body.notes = String(input.notes).trim();
|
|
205
|
+
if (input.isBroadcastAllowed === "true" || input.isBroadcastAllowed === "false") {
|
|
206
|
+
body.isBroadcastAllowed = input.isBroadcastAllowed === "true";
|
|
207
|
+
} else if (typeof input.isBroadcastAllowed === "boolean") {
|
|
208
|
+
body.isBroadcastAllowed = input.isBroadcastAllowed;
|
|
209
|
+
}
|
|
210
|
+
const labels = choiceList(input.labelAction, input.labelId);
|
|
211
|
+
if (labels) body.labels = labels;
|
|
212
|
+
const attributes = choiceList(input.attributeAction, input.attributeId);
|
|
213
|
+
if (attributes) {
|
|
214
|
+
body.attributes =
|
|
215
|
+
input.attributeAction === "remove"
|
|
216
|
+
? [{ id: "__none__" }]
|
|
217
|
+
: [{ id: String(input.attributeId), value: String(input.attributeValue || "") }];
|
|
218
|
+
}
|
|
219
|
+
return body;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
module.exports = {
|
|
223
|
+
flattenEvent,
|
|
224
|
+
eventMatches,
|
|
225
|
+
variablesFromCollection,
|
|
226
|
+
splitTemplateId,
|
|
227
|
+
buildTemplateBody,
|
|
228
|
+
contactFields,
|
|
229
|
+
liveChatUrl,
|
|
230
|
+
withoutIds,
|
|
231
|
+
};
|