Class MarketingConsentSubscription
dw.customer.consent
Class MarketingConsentSubscription
Object
dw.customer.consent.MarketingConsentSubscription
Represents a marketing consent subscription for a shopper.

A marketing consent subscription defines a communication preference category (e.g., "Newsletter", "Product Updates") with associated channels (EMAIL, SMS, WHATSAPP) through which the shopper can receive marketing communications.

Example usage:

 
 var subscriptions = dw.customer.consent.ShopperConsentMgr.getSubscriptions();
 for each (var sub in subscriptions) {
     trace('Subscription: ' + sub.subscriptionId + ' - ' + sub.title);
     trace('Channels: ' + sub.channels);
 }
 
 

Properties
channels  :  String[]  (Read Only)
The available channels for this subscription.

Channels represent the communication methods (EMAIL, SMS, WHATSAPP) available for this subscription.

consentRequired  :  boolean  (Read Only)
Returns whether consent is required for this subscription.
consentStatus  :  Collection  (Read Only)
The consent status entries for this subscription.

This is only populated when the 'includeConsentStatus' parameter is true in the getSubscriptions call, and the customer is authenticated.

consentType  :  String  (Read Only)
The consent type for this subscription.
defaultStatus  :  String  (Read Only)
The default consent status for this subscription.
subscriptionId  :  String  (Read Only)
The unique identifier for this subscription.
subtitle  :  String  (Read Only)
The localized subtitle of this subscription.
tags  :  String[]  (Read Only)
The tags associated with this subscription.

Tags can be used to categorize and filter subscriptions.

title  :  String  (Read Only)
The localized title of this subscription.
Constructor Summary
This class does not have a constructor, so you cannot create it directly.
Method Summary
getChannels() : String[]
Returns the available channels for this subscription.
getConsentRequired() : boolean
Returns whether consent is required for this subscription.
getConsentStatus() : Collection
Returns the consent status entries for this subscription.
getConsentType() : String
Returns the consent type for this subscription.
getDefaultStatus() : String
Returns the default consent status for this subscription.
getSubscriptionId() : String
Returns the unique identifier for this subscription.
getSubtitle() : String
Returns the localized subtitle of this subscription.
getTags() : String[]
Returns the tags associated with this subscription.
getTitle() : String
Returns the localized title of this subscription.
Method Detail
getChannels
getChannels() : String[]
Returns the available channels for this subscription.

Channels represent the communication methods (EMAIL, SMS, WHATSAPP) available for this subscription.

Returns:
A list of channel strings (lowercase).

getConsentRequired
getConsentRequired() : boolean
Returns whether consent is required for this subscription.
Returns:
True if consent is required, false otherwise.

getConsentStatus
getConsentStatus() : Collection
Returns the consent status entries for this subscription.

This is only populated when the 'includeConsentStatus' parameter is true in the getSubscriptions call, and the customer is authenticated.

Returns:
A collection of ConsentStatusEntry objects, or null if not requested.

getConsentType
getConsentType() : String
Returns the consent type for this subscription.
Returns:
The consent type (e.g., "SINGLE_OPT_IN", "DOUBLE_OPT_IN").

getDefaultStatus
getDefaultStatus() : String
Returns the default consent status for this subscription.
Returns:
The default status (e.g., "OPT_IN", "OPT_OUT").

getSubscriptionId
getSubscriptionId() : String
Returns the unique identifier for this subscription.
Returns:
The subscription ID.

getSubtitle
getSubtitle() : String
Returns the localized subtitle of this subscription.
Returns:
The subscription subtitle.

getTags
getTags() : String[]
Returns the tags associated with this subscription.

Tags can be used to categorize and filter subscriptions.

Returns:
A list of tag strings.

getTitle
getTitle() : String
Returns the localized title of this subscription.
Returns:
The subscription title.