SubscriptionDefinitionAddSubscription Method (String, SubscriberAddress, String, Object, 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.

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,
	string membershipProviderName,
	Object identifierInMembershipProvider,
	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) .
membershipProviderName
Type: SystemString
Name of the membership provider. This parameter can be null (Nothing in Visual Basic) if no membership provider is associated with the subscriber.
identifierInMembershipProvider
Type: SystemObject
The identifier of the subscriber in the membership provider. This parameter can be null (Nothing in Visual Basic) if no membership provider is associated with the subscriber.
allowUpdate
Type: SystemBoolean
Specifies whether the name, membershipProviderName and identifierInMembershipProvider will be updated if a subscription with the address specified already exists.

Return Value

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

The following properties will have values that are not reliable.

  • CategoryId
  • CategoryName
  • Description
  • Enabled
These properties are defined on the definition and category objects and is not read for performance reasons.

Exceptions

ExceptionCondition
CSException
NumberDescription
1022The definition represented by the Identifier property is not enabled for subscription.
1503The category does not exist, or the definition represented by the Identifier property 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)
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 it will be updated only if the allowUpdate parameter is true.

You cannot add subscriptions if the subscription definition is disabled.

See Also

Reference