After lots of research and checking through the CRM API, it seems that it is not possible to set the subscription via code to the create contact function. Is this correct? It seems a little strange that you can code so many other element but subscription? This is my code which creates the contact but won’t set the subscription. Any ideas?
To clarify, the code works and creates the contact, just won’t set the subscription. And no errors are thrown.
function saveCRMPrefrences() {
let firstName = "Stephen"
let lastName = "Test"
let email = 'stephentest@hotmail.com'
let phone = "444809256050"
let label = "subscribed"
wixCrm.createContact({
"firstName": firstName,
"lastName": lastName,
"emails": [email],
"phones": [phone],
"subscription": label
})
.then((contactId) => {
console.log('Create Contact - SUCCESS')
})
.catch((err) => {
console.log("Error saving Create Contact");
console.log(`${err}: Error`)
});
}
CRM API does not provide ability to set subscription. I have tried to find workarounds in the past but no success till date. Only way you can do it right now is with Wix Forms.
Thanks @Yisrael
When you send this over, could you mention that when you export the contacts list, then import to another site (I’m currently transferring to Editor X) the subscriptions are all reset to ‘Subscription not set’ So I now have over 120 subscriptions to change to ‘Subscribed’
@yisrael-wix it’s been almost 2 years… I do see that there’s now a CRM API. But I don’t think there’s a solution there - is there? I’m only looking for read capability, not even write. Is there some other solutio I’m missing?