You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to reuse the existing anonymous guest checkout API call as an example to create an email signup request that would create an anonymous user in service cloud based on a form submission. I'd like to include the PersonHasOptedOutOfEmail field to store whether or not the customer opted into emails when submitting the form.
So far the code looks something like this and works if I do not provide a PersonHasOptedOutOfEmail property on the JSON object. If that field is provided the flow returns an UNKNOWN error.
var DEFAULT_LAST_NAME = "LastNameNotProvided";
var profileRequestObjectRepresentation = JSON.stringify({
inputs: [{
sourceContact: {
Email: email,
LastName: lastname || DEFAULT_LAST_NAME,
B2C_CustomerList_ID__c: require('dw/customer/CustomerMgr').getSiteCustomerList().getID(),
PersonHasOptedOutOfEmail: true
}
}]
});
var result = ServiceMgr.callRestService('customer', 'process', profileRequestObjectRepresentation);
I think this error could be solved by adding a mapping in the screenshot below. However, I do not intend on making this a field within commerce cloud on the customer profile as I do not want commerce to end up being the system of record for this field.
I would only like to send updates to this field if the user has opted into marketing emails.
If I do have to add this to the profile in order to make this work, are there settings to only sync once?
I'd really love to take advantage of this flow if possible rather than writing a custom solution for this. Any help would be greatly appreciated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to reuse the existing anonymous guest checkout API call as an example to create an email signup request that would create an anonymous user in service cloud based on a form submission. I'd like to include the PersonHasOptedOutOfEmail field to store whether or not the customer opted into emails when submitting the form.
So far the code looks something like this and works if I do not provide a PersonHasOptedOutOfEmail property on the JSON object. If that field is provided the flow returns an UNKNOWN error.
I think this error could be solved by adding a mapping in the screenshot below. However, I do not intend on making this a field within commerce cloud on the customer profile as I do not want commerce to end up being the system of record for this field.
I would only like to send updates to this field if the user has opted into marketing emails.
If I do have to add this to the profile in order to make this work, are there settings to only sync once?
I'd really love to take advantage of this flow if possible rather than writing a custom solution for this. Any help would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions