Comparing version 2.12.1 to 2.13.0
const { withClient } = require('../helpers') | ||
const preferenceTagsPath = 'customer/preference_tags/by_email/' | ||
const preferenceTagsRemovePath = 'customer/preference_tags/remove/by_email/' | ||
const customerEndpoint = (client) => { | ||
@@ -39,2 +42,31 @@ const endpoint = 'customer' | ||
}, | ||
preferenceTags: { | ||
get: (email) => { | ||
const params = { email } | ||
const config = { params } | ||
return dispatchReturnData('get')(preferenceTagsPath, config) | ||
}, | ||
set: (email, tags) => { | ||
const params = { email } | ||
const data = { preference_tags: tags } | ||
const config = { params, data } | ||
return dispatchReturnData('put')(preferenceTagsPath, config) | ||
}, | ||
add: (email, tags) => { | ||
const params = { email } | ||
const data = { preference_tags: tags } | ||
const config = { params, data } | ||
return dispatchReturnData('patch')(preferenceTagsPath, config) | ||
}, | ||
remove: (email, tags) => { | ||
const params = { email } | ||
const data = { preference_tags: tags } | ||
const config = { params, data } | ||
return dispatchReturnData('patch')(preferenceTagsRemovePath, config) | ||
}, | ||
}, | ||
} | ||
@@ -41,0 +73,0 @@ } |
{ | ||
"name": "rejoiner", | ||
"description": "Rejoiner REST API client wrapper for Node.js", | ||
"version": "2.12.1", | ||
"version": "2.13.0", | ||
"main": "lib/rejoiner.js", | ||
@@ -6,0 +6,0 @@ "author": "Sascha Bratton <sascha@brattonbratton.com>", |
@@ -114,2 +114,36 @@ # Rejoiner Node.js client wrapper | ||
### Customer Preference Tags | ||
### Get Preference Tags | ||
````js | ||
client.customer.preferenceTags.get('test@example.com') | ||
.then(...) | ||
.catch(...) | ||
```` | ||
### Replace Preference Tags | ||
````js | ||
client.customer.preferenceTags.set('test@example.com', ['example-tag']) | ||
.then(...) | ||
.catch(...) | ||
```` | ||
### Add Preference Tags | ||
````js | ||
client.customer.preferenceTags.add('test@example.com', ['example-tag']) | ||
.then(...) | ||
.catch(...) | ||
```` | ||
### Remove Preference Tags | ||
````js | ||
client.customer.preferenceTags.remove('test@example.com', ['example-tag']) | ||
.then(...) | ||
.catch(...) | ||
```` | ||
## Email List Endpoints | ||
@@ -116,0 +150,0 @@ |
14349
259
189