SubscriptionDefinitionAddSubscription Method (String, SubscriberAddress, Boolean) Content Studio 5.7 SDK
Content Studio Web Content Management System

[This is preliminary documentation and is subject to change.]

Adds the subscription to the current subscription definition without any MembershipProvider data.

Namespace: ContentStudio.Document.Subscription
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax

public Subscription AddSubscription(
	string name,
	SubscriberAddress address,
	bool allowUpdate
)

Parameters

name
Type: SystemString
The name of the subscriber.
address
Type: ContentStudio.Document.SubscriptionSubscriberAddress
An instance of a SubscriberAddress that specifies the address of the subscriber. This parameter cannot be null (Nothing in Visual Basic) .
allowUpdate
Type: SystemBoolean
Specifies whether the name will be updated if a subscription with the address specified already exists.

Return Value

Type: Subscription
A Subscription that represents the newly added subscription.
Exceptions

ExceptionCondition
CSException
NumberDescription
1022The definition represented by the Identifier parameter is not enabled for subscription.
1503The category does not exist, or the definition represented by the Identifier parameter does not exist.
CSPermissionDeniedExceptionThe caller has no permission to perform the requested action
CSInvalidSessionExceptionThe session is invalid
ArgumentNullExceptionThe address cannot be null (Nothing in Visual Basic)
NotSupportedExceptionThe value of SubscriptionType parameter is not supported.
InvalidOperationExceptionCannot add a new subscriber to a definition that has not been saved for the first time.
SqlExceptionAn error occurred when executing the command against the Content Studio database
Content Studio permissions

For Newsletter subscriptions, this method can successfully be executed by any authenticated or anonymous caller.
Remarks

A subscription is identified on its address and address type and if the subscription already exists and the allowUpdate parameter is true the name will be updated.

You cannot add subscriptions if the subscription definition is disabled.

See Also

Reference