Class MarketingConsentSubscription

<!-- prettier-ignore-start -->

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);
}

Property Summary

Property Description
channels: String[] (read-only) Returns the available channels for this subscription.
consentRequired: Boolean (read-only) Returns whether consent is required for this subscription.
consentStatus: Collection (read-only) Returns the consent status entries for this subscription.
consentType: String (read-only) Returns the consent type for this subscription.
defaultStatus: String (read-only) Returns the default consent status for this subscription.
subscriptionId: String (read-only) Returns the unique identifier for this subscription.
subtitle: String (read-only) Returns the localized subtitle of this subscription.
tags: String[] (read-only) Returns the tags associated with this subscription.
title: String (read-only) Returns the localized title of this subscription.

Constructor Summary

This class does not have a constructor, so you cannot create it directly.

Method Summary

Method Description
getChannels() Returns the available channels for this subscription.
getConsentRequired() Returns whether consent is required for this subscription.
getConsentStatus() Returns the consent status entries for this subscription.
getConsentType() Returns the consent type for this subscription.
getDefaultStatus() Returns the default consent status for this subscription.
getSubscriptionId() Returns the unique identifier for this subscription.
getSubtitle() Returns the localized subtitle of this subscription.
getTags() Returns the tags associated with this subscription.
getTitle() Returns the localized title of this subscription.

Methods inherited from class Object

assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values

Property Details

channels

  • channels: String[] (read-only)
    • : Returns the available channels for this subscription.

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


consentRequired

  • consentRequired: Boolean (read-only)
    • : Returns whether consent is required for this subscription.

consentStatus

  • consentStatus: Collection (read-only)
    • : 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.


consentType

  • consentType: String (read-only)
    • : Returns the consent type for this subscription.

defaultStatus

  • defaultStatus: String (read-only)
    • : Returns the default consent status for this subscription.

subscriptionId

  • subscriptionId: String (read-only)
    • : Returns the unique identifier for this subscription.

subtitle

  • subtitle: String (read-only)
    • : Returns the localized subtitle of this subscription.

tags

  • tags: String[] (read-only)
    • : Returns the tags associated with this subscription.

      Tags can be used to categorize and filter subscriptions.


title

  • title: String (read-only)
    • : Returns the localized title of this subscription.

Method Details

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.

<!-- prettier-ignore-end -->