Class NewsletterModelService
Provides services related to Newsletter models.
Implements
Inherited Members
Namespace: DataWeb.Newsletter
Assembly: DataWeb.Core.dll
Syntax
public class NewsletterModelService : INewsletterModelService
Constructors
NewsletterModelService(IHttpService, IRazorTemplateService, INewsletterModelStore, INewsletterRowStore, INewsletterEventStore, TimeProvider)
Initializes a new instance of the NewsletterModelService class.
Declaration
public NewsletterModelService(IHttpService httpService, IRazorTemplateService templateService, INewsletterModelStore newsletterModelStore, INewsletterRowStore newsletterRowStore, INewsletterEventStore newsletterEventStore, TimeProvider timeProvider)
Parameters
Type | Name | Description |
---|---|---|
IHttpService | httpService | The HTTP service. |
IRazorTemplateService | templateService | The template service. |
INewsletterModelStore | newsletterModelStore | The Newsletter model store. |
INewsletterRowStore | newsletterRowStore | The Newsletter row store. |
INewsletterEventStore | newsletterEventStore | The Newsletter event store. |
TimeProvider | timeProvider |
Methods
GetCreditsAsync(ProvisioningApp, CancellationToken)
Gets the credits available for sending Newsletters for a given ProvisioningApp.
Declaration
public Task<NewsletterCredits> GetCreditsAsync(ProvisioningApp app, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
ProvisioningApp | app | The ProvisioningApp. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<NewsletterCredits> | The Newsletter credits. |
GetModelAsync(NewsletterModelFilter, CancellationToken)
Gets the Newsletter model based on filter criteria.
Declaration
public Task<NewsletterModel> GetModelAsync(NewsletterModelFilter filter, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
NewsletterModelFilter | filter | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<NewsletterModel> | The Newsletter model. |
GetModelsAsync(NewsletterModelFilter, CancellationToken)
Gets a list of Newsletter models based on filter criteria.
Declaration
public Task<IEnumerable<NewsletterModel>> GetModelsAsync(NewsletterModelFilter filter, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
NewsletterModelFilter | filter | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IEnumerable<NewsletterModel>> | The list of Newsletter models. |
RenderBodyAsync(NewsletterModel, string, CancellationToken)
Service responsible for rendering the body of a newsletter model, replacing placeholders and adding UTM parameters and hit tracking links.
Declaration
public Task<string> RenderBodyAsync(NewsletterModel newsletterModel, string newsletterRowIdMaster = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
NewsletterModel | newsletterModel | The newsletter model to render. |
string | newsletterRowIdMaster | The Id of the newsletter row, if rendering for a specific row. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<string> | The rendered HTML body of the newsletter. |