Content Studio Web Content Management System
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
A Subscription instance that represents the newly added subscription.
For Newsletter subscriptions, this method can successfully be executed by any authenticated or anonymous caller.
[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: SubscriptionA Subscription instance that represents the newly added subscription.
The following properties will have values that are not reliable.
- CategoryId
- CategoryName
- Description
- Enabled
Exceptions
Exception | Condition | ||||||
---|---|---|---|---|---|---|---|
CSException |
| ||||||
CSPermissionDeniedException | The caller has no permission to perform the requested action | ||||||
CSInvalidSessionException | The session is invalid | ||||||
ArgumentNullException | The address cannot be null (Nothing in Visual Basic) | ||||||
InvalidOperationException | Cannot add a new subscriber to a definition that has not been saved for the first time. | ||||||
SqlException | An error occurred when executing the command against the Content Studio database |
Content Studio permissions
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