Save a customer preference using customer id.
const notihub = new Notihub({ ...yourKeys });
notihub.customerContacts.createOrUpdate({
customerId: 'customer-id',
templateGroupId: 'template-group-id',
mechanisms: ['EMAIL', 'PUSH'] // Values can be EMAIL, PUSH and/or SMS. NONE is used to turn off.
}).then(customerPreference => { // Successful response
console.log(customerPreference.templateGroupId);
}).catch(error => { // Catch error here.
console.error(error)
});
Retrieve a customer preference by customer id.
const notihub = new Notihub({ ...yourKeys });
notihub.customerContacts.get('customer-id')
.then(customerPreference => { // Successful response
console.log(customerPreference.templateGroupId);
}).catch(error => { // Catch error here.
console.error(error)
});