@wokuapp/sdk 0.2.1 → 0.2.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.
- package/README.md +9 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -50,18 +50,25 @@ const tracker = await woku.trackers.create({
|
|
|
50
50
|
system: 'retail',
|
|
51
51
|
});
|
|
52
52
|
|
|
53
|
-
// Create an NPS tool
|
|
53
|
+
// Create an NPS tool.
|
|
54
54
|
const tool = await woku.npsTools.create({
|
|
55
55
|
name: 'Post-purchase',
|
|
56
56
|
npsMessage: 'How likely are you to recommend us?',
|
|
57
57
|
});
|
|
58
|
+
|
|
59
|
+
// Tag the NPS tool with the tracker, so every response is grouped by store.
|
|
60
|
+
await woku.trackers.assignToEntity('nps', tool._id, {
|
|
61
|
+
name: tracker.name,
|
|
62
|
+
value: 'TX-42',
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// Send it, then read delivery + response rate.
|
|
58
66
|
await woku.nps.sendInvitations({
|
|
59
67
|
channel: 'email',
|
|
60
68
|
npsToolId: tool._id,
|
|
61
69
|
recipients: ['ana@example.com'],
|
|
62
70
|
});
|
|
63
71
|
|
|
64
|
-
// Read delivery + response rate.
|
|
65
72
|
const stats = await woku.dispatches.stats({ channel: 'email' });
|
|
66
73
|
console.log(stats.responseRate);
|
|
67
74
|
```
|
package/package.json
CHANGED