mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-07-16 17:47:22 +00:00
Format ./web/backend/Infrastructure/Infrastructure.Email.Templates
This commit is contained in:
@@ -14,10 +14,8 @@ namespace Infrastructure.Email.Templates.Rendering;
|
||||
/// pipeline.
|
||||
/// </param>
|
||||
/// <param name="loggerFactory">The logger factory passed to the <see cref="HtmlRenderer" /> used to render components.</param>
|
||||
public class EmailTemplateProvider(
|
||||
IServiceProvider serviceProvider,
|
||||
ILoggerFactory loggerFactory
|
||||
) : IEmailTemplateProvider
|
||||
public class EmailTemplateProvider(IServiceProvider serviceProvider, ILoggerFactory loggerFactory)
|
||||
: IEmailTemplateProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// Renders the UserRegisteredEmail template with the specified parameters.
|
||||
@@ -33,7 +31,7 @@ public class EmailTemplateProvider(
|
||||
Dictionary<string, object?> parameters = new()
|
||||
{
|
||||
{ nameof(UserRegistration.Username), username },
|
||||
{ nameof(UserRegistration.ConfirmationLink), confirmationLink }
|
||||
{ nameof(UserRegistration.ConfirmationLink), confirmationLink },
|
||||
};
|
||||
|
||||
return await RenderComponentAsync<UserRegistration>(parameters);
|
||||
@@ -53,7 +51,7 @@ public class EmailTemplateProvider(
|
||||
Dictionary<string, object?> parameters = new()
|
||||
{
|
||||
{ nameof(ResendConfirmation.Username), username },
|
||||
{ nameof(ResendConfirmation.ConfirmationLink), confirmationLink }
|
||||
{ nameof(ResendConfirmation.ConfirmationLink), confirmationLink },
|
||||
};
|
||||
|
||||
return await RenderComponentAsync<ResendConfirmation>(parameters);
|
||||
@@ -72,10 +70,7 @@ public class EmailTemplateProvider(
|
||||
)
|
||||
where TComponent : IComponent
|
||||
{
|
||||
await using HtmlRenderer htmlRenderer = new(
|
||||
serviceProvider,
|
||||
loggerFactory
|
||||
);
|
||||
await using HtmlRenderer htmlRenderer = new(serviceProvider, loggerFactory);
|
||||
|
||||
string html = await htmlRenderer.Dispatcher.InvokeAsync(async () =>
|
||||
{
|
||||
@@ -89,4 +84,4 @@ public class EmailTemplateProvider(
|
||||
|
||||
return html;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,7 @@ public interface IEmailTemplateProvider
|
||||
/// <param name="username">The username to include in the email</param>
|
||||
/// <param name="confirmationLink">The email confirmation link</param>
|
||||
/// <returns>The rendered HTML string</returns>
|
||||
Task<string> RenderUserRegisteredEmailAsync(
|
||||
string username,
|
||||
string confirmationLink
|
||||
);
|
||||
Task<string> RenderUserRegisteredEmailAsync(string username, string confirmationLink);
|
||||
|
||||
/// <summary>
|
||||
/// Renders the ResendConfirmation template with the specified parameters.
|
||||
@@ -22,8 +19,5 @@ public interface IEmailTemplateProvider
|
||||
/// <param name="username">The username to include in the email</param>
|
||||
/// <param name="confirmationLink">The new confirmation link</param>
|
||||
/// <returns>The rendered HTML string</returns>
|
||||
Task<string> RenderResendConfirmationEmailAsync(
|
||||
string username,
|
||||
string confirmationLink
|
||||
);
|
||||
}
|
||||
Task<string> RenderResendConfirmationEmailAsync(string username, string confirmationLink);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user