update infra docs

This commit is contained in:
Aaron Po
2026-08-04 06:18:54 -04:00
parent 19dfad5ab5
commit f9acdc8ada
11 changed files with 21 additions and 151 deletions

View File

@@ -9,20 +9,9 @@ namespace Infrastructure.Email.Templates.Rendering;
/// <summary>
/// Service for rendering Razor email templates to HTML using HtmlRenderer.
/// </summary>
/// <param name="serviceProvider">
/// The service provider used to resolve dependencies for the Razor component 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
{
/// <summary>
/// Renders the UserRegisteredEmail template with the specified parameters.
/// </summary>
/// <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>
public async Task<string> RenderUserRegisteredEmailAsync(
string username,
string confirmationLink
@@ -37,12 +26,6 @@ public class EmailTemplateProvider(IServiceProvider serviceProvider, ILoggerFact
return await RenderComponentAsync<UserRegistration>(parameters);
}
/// <summary>
/// Renders the ResendConfirmation template with the specified parameters.
/// </summary>
/// <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>
public async Task<string> RenderResendConfirmationEmailAsync(
string username,
string confirmationLink
@@ -58,13 +41,9 @@ public class EmailTemplateProvider(IServiceProvider serviceProvider, ILoggerFact
}
/// <summary>
/// Generic method to render any Razor component to HTML.
/// Creates a scoped <see cref="HtmlRenderer" />, dispatches the render onto its renderer thread,
/// and returns the resulting HTML string.
/// </summary>
/// <typeparam name="TComponent">The type of the Razor component to render.</typeparam>
/// <param name="parameters">A dictionary of parameter names and values to pass to the component.</param>
/// <returns>The rendered HTML string for the component.</returns>
private async Task<string> RenderComponentAsync<TComponent>(
Dictionary<string, object?> parameters
)