Click or drag to resize
ISubscriptionServiceGetAllActiveSubscriptions Method
Method returns all subscriptions for given contact. Contact can be subscribed directly or using contact group. Only active subscriptions are retrieved (not approved one are omitted, unsubscriptions are reflected). Does not filter out subscriptions blocked using bounces.

Namespace: CMS.Newsletters
Assembly: CMS.Newsletters (in CMS.Newsletters.dll) Version: 13.0.131
Syntax
C#
ObjectQuery<SubscriberNewsletterInfo> GetAllActiveSubscriptions(
	int contactId
)

Parameters

contactId
Type: SystemInt32
ContactId that subscriptions are returned for

Return Value

Type: ObjectQuerySubscriberNewsletterInfo
Returns ObjectQuery with all SubscriberNewsletterInfo objects that are valid for the given contact
Examples
Example shows how to get all newsletters the current contact is subscribed to
var newsletterIds = Service<ISubscriptionService>.Entry().GetAllActiveSubscriptions(currentContact);
                                                         .Column("NewsletterID")
                                                         .Distinct()
See Also