Interface INewsletterEventService
Represents a service for managing newsletter events.
Namespace: DataWeb.Newsletter
Assembly: DataWeb.Core.dll
Syntax
public interface INewsletterEventService
Methods
BatchInsertEventsAsync(string, List<NewsletterEventBatchInsert>, CancellationToken)
Inserts a batch of newsletter events for a given row id master.
Declaration
Task BatchInsertEventsAsync(string rowIdMaster, List<NewsletterEventBatchInsert> events, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | rowIdMaster | The row id master for which the events will be inserted. |
List<NewsletterEventBatchInsert> | events | The list of NewsletterEventBatchInsert to insert. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous operation. |
ConvertEventType(string)
Converts a string value to a newsletter event type enum value.
Declaration
NewsletterEventType ConvertEventType(string value)
Parameters
Type | Name | Description |
---|---|---|
string | value | The string value to convert. |
Returns
Type | Description |
---|---|
NewsletterEventType | The corresponding newsletter event type enum value. |
GetMailEventSentAsync(string, string, CancellationToken)
Retrieves the most recent newsletter event of type Sent associated with a specific email address and row identifier.
Declaration
Task<NewsletterEvent> GetMailEventSentAsync(string email, string rowIdMaster, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | The email address to retrieve the newsletter event for. |
|
string | rowIdMaster | The row identifier to retrieve the newsletter event for. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<NewsletterEvent> | The most recent newsletter event of type Sent associated with the specified email address and row identifier. |
GetMailEventsAsync(string, CancellationToken)
Retrieves all newsletter events associated with a specific email address.
Declaration
Task<IEnumerable<NewsletterEvent>> GetMailEventsAsync(string email, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | The email address to retrieve newsletter events for. |
|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IEnumerable<NewsletterEvent>> | An enumerable collection of newsletter events. |
GetRowEventsAsync(string, NewsletterEventType, CancellationToken)
Retrieves all newsletter events associated with a specific row identifier and event type.
Declaration
Task<IEnumerable<NewsletterEvent>> GetRowEventsAsync(string rowIdMaster, NewsletterEventType eventType, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | rowIdMaster | The row identifier to retrieve newsletter events for. |
NewsletterEventType | eventType | The NewsletterEventType to retrieve newsletter events for. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IEnumerable<NewsletterEvent>> | An enumerable collection of newsletter events. |
GetWorkedCountAsync(string, CancellationToken)
Retrieves the number of times a specific row identifier has been marked as worked.
Declaration
Task<long> GetWorkedCountAsync(string rowIdMaster, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | rowIdMaster | The row identifier to retrieve the worked count for. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<long> | The number of times the specified row identifier has been marked as worked. |
IsMailInMailingListAsync(string, string, CancellationToken)
Determines whether a specific email address is in the mailing list for a specific row identifier.
Declaration
Task<bool> IsMailInMailingListAsync(string email, string rowIdMaster = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | The email address to check for. |
|
string | rowIdMaster | The row identifier to check for. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<bool> | true if the email address is in the mailing list for the specified row identifier; otherwise, false. |
IsMultipleDeliveryFailAsync(string, CancellationToken)
Determines whether a specific email address has failed delivery for at least three newsletter events of type Failed.
Declaration
Task<bool> IsMultipleDeliveryFailAsync(string email, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | The email address to check for. |
|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<bool> | true if the email address has failed delivery for at least three newsletter events of type Failed; otherwise, false. |
RemoveOldNewsletterEventsAsync(CancellationToken)
Removes old newsletter events from the event store.
Declaration
Task RemoveOldNewsletterEventsAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous operation. |
SetNewsletterEventAsync(string, NewsletterEventType, string, string, CancellationToken)
Adds a new newsletter event.
Declaration
Task SetNewsletterEventAsync(string email, NewsletterEventType eventType, string description = null, string rowIdMaster = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | The email address to associate the newsletter event with. |
|
NewsletterEventType | eventType | The NewsletterEventType of the newsletter event. |
string | description | The description of the newsletter event. |
string | rowIdMaster | The row identifier to associate the newsletter event with. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task | A task representing the asynchronous operation. |