protected void btnUnsubscribeFromAll_Click(object sender, EventArgs e) { if (userIsIdentified && IsLiveSite) { string email = userInfo.Email; var isUnsubscribed = mUnsubscriptionProvider.IsUnsubscribedFromAllNewsletters(email, SiteContext.CurrentSiteID); if (!isUnsubscribed) { mSubscriptionService.UnsubscribeFromAllNewsletters(email, SiteContext.CurrentSiteID); } else { mUnsubscriptionProvider.RemoveUnsubscriptionsFromAllNewsletters(email, SiteContext.CurrentSiteID); } } }
protected void btnUnsubscribeFromAll_Click(object sender, EventArgs e) { if (IsUserIdentified() && IsLiveSite) { string email = GetVisitorEmail(); var isUnsubscribed = mUnsubscriptionProvider.IsUnsubscribedFromAllNewsletters(email); if (!isUnsubscribed) { mSubscriptionService.UnsubscribeFromAllNewsletters(email); } else { mUnsubscriptionProvider.RemoveUnsubscriptionsFromAllNewsletters(email); } } }