Class NewsletterSubscriberService
Provides operations for managing newsletter subscribers.
Inheritance
NewsletterSubscriberService
Assembly: DataWeb.Core.dll
Syntax
public class NewsletterSubscriberService : INewsletterSubscriberService
Constructors
NewsletterSubscriberService(IConfigurationService, IDataProtectionProvider, INewsletterSubscriberStore, IHttpService, IEmailService, IHtmlService, IRazorTemplateService, IStringLocalizer, TimeProvider)
Provides operations for managing newsletter subscribers.
Declaration
public NewsletterSubscriberService(IConfigurationService configurationService, IDataProtectionProvider dataProtectionProvider, INewsletterSubscriberStore subscriberStore, IHttpService httpService, IEmailService emailService, IHtmlService htmlService, IRazorTemplateService templateService, IStringLocalizer localizer, TimeProvider timeProvider)
Parameters
Properties
AppSettings
Gets the application settings.
Declaration
public ConfigurationAppSettings AppSettings { get; }
Property Value
Methods
ConfirmEmailAsync(NewsletterSubscriber, string, CancellationToken)
Declaration
public Task<ConfirmEmailResult> ConfirmEmailAsync(NewsletterSubscriber subscriber, string code, CancellationToken cancellationToken = default)
Parameters
Returns
ConvertStatus(string)
Converts the given value to a subscriber status.
Declaration
public SubscriberStatus ConvertStatus(string value)
Parameters
Type |
Name |
Description |
string |
value |
|
Returns
DeserializeAdditionalValues(string)
Deserializes the additional values of a subscriber.
Declaration
public List<NewsletterSubscriber.AdditionalValue> DeserializeAdditionalValues(string value)
Parameters
Type |
Name |
Description |
string |
value |
|
Returns
GenerateEmailConfirmationToken(NewsletterSubscriber)
Declaration
public string GenerateEmailConfirmationToken(NewsletterSubscriber subscriber)
Parameters
Returns
GetSMTPErrors()
Gets a list of SMTP errors.
Declaration
public List<List.ListItem> GetSMTPErrors()
Returns
GetSubscriberAsync(NewsletterSubscriberFilter, CancellationToken)
Declaration
public Task<NewsletterSubscriber> GetSubscriberAsync(NewsletterSubscriberFilter filter, CancellationToken cancellationToken = default)
Parameters
Returns
GetSubscriberCountAsync(NewsletterSubscriberFilter, CancellationToken)
Declaration
public Task<long> GetSubscriberCountAsync(NewsletterSubscriberFilter filter, CancellationToken cancellationToken = default)
Parameters
Returns
GetSubscribersAsync(NewsletterSubscriberFilter, CancellationToken)
Declaration
public Task<IEnumerable<NewsletterSubscriber>> GetSubscribersAsync(NewsletterSubscriberFilter filter, CancellationToken cancellationToken = default)
Parameters
Returns
MergeAdditionalValues(List<AdditionalValue>, List<AdditionalValue>)
Merges a list of existing additional values with a list of provided additional values.
Declaration
public List<NewsletterSubscriber.AdditionalValue> MergeAdditionalValues(List<NewsletterSubscriber.AdditionalValue> existingAdditionalValues, List<NewsletterSubscriber.AdditionalValue> providedAdditionalValues)
Parameters
Returns
MergeStringValues(List<string>, List<string>)
Merges a list of existing string values with a list of provided string values.
Declaration
public List<string> MergeStringValues(List<string> existingValues, List<string> providedValues)
Parameters
Returns
RemoveAsync(string, CancellationToken)
Removes the subscriber with the given Id.
Declaration
public Task RemoveAsync(string id, CancellationToken cancellationToken = default)
Parameters
Returns
RemoveGroupAsync(string, string, CancellationToken)
Removes the given group from the subscriber.
Declaration
public Task RemoveGroupAsync(string subscriberId, string group, CancellationToken cancellationToken = default)
Parameters
Returns
SendEmailConfirmAsync(NewsletterSubscriber, string, CancellationToken)
Declaration
public Task SendEmailConfirmAsync(NewsletterSubscriber subscriber, string emailConfirmUrl, CancellationToken cancellationToken = default)
Parameters
Returns
SerializeAdditionalValues(List<AdditionalValue>)
Serializes the additional values of a subscriber.
Declaration
public string SerializeAdditionalValues(List<NewsletterSubscriber.AdditionalValue> additionalValues)
Parameters
Returns
SetAsync(NewsletterSubscriber, CancellationToken)
Declaration
public Task SetAsync(NewsletterSubscriber subscriber, CancellationToken cancellationToken = default)
Parameters
Returns
SubscribeAsync(string, string, string, string, string, List<string>, List<string>, List<AdditionalValue>, bool, bool, CancellationToken)
Subscribes a new email address to the newsletter.
Declaration
public Task<SubscribeResult> SubscribeAsync(string email, string culture, string source, string country = null, string zone = null, List<string> interests = null, List<string> groups = null, List<NewsletterSubscriber.AdditionalValue> additionalValues = null, bool isKeepStatus = false, bool isRequireConfirmedEmail = false, CancellationToken cancellationToken = default)
Parameters
Returns
UnsubscribeAsync(string, CancellationToken)
Unsubscribes the email address from the newsletter.
Declaration
public Task<UnsubscribeResult> UnsubscribeAsync(string email, CancellationToken cancellationToken = default)
Parameters
Returns
Implements