mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-15 18:14:44 +00:00
update features docs
This commit is contained in:
@@ -8,7 +8,6 @@ namespace Features.Emails.Commands.SendRegistrationEmail;
|
||||
/// Handles <see cref="SendRegistrationEmailCommand" />, the cross-slice command sent by Features.Auth
|
||||
/// after a new user registers.
|
||||
/// </summary>
|
||||
/// <param name="emailDispatcher">Dispatcher used to render and send the email.</param>
|
||||
public class SendRegistrationEmailHandler(IEmailDispatcher emailDispatcher)
|
||||
: IRequestHandler<SendRegistrationEmailCommand>
|
||||
{
|
||||
|
||||
@@ -8,7 +8,6 @@ namespace Features.Emails.Commands.SendResendConfirmationEmail;
|
||||
/// Handles <see cref="SendResendConfirmationEmailCommand" />, the cross-slice command sent by Features.Auth
|
||||
/// when a user requests a fresh confirmation link.
|
||||
/// </summary>
|
||||
/// <param name="emailDispatcher">Dispatcher used to render and send the email.</param>
|
||||
public class SendResendConfirmationEmailHandler(IEmailDispatcher emailDispatcher)
|
||||
: IRequestHandler<SendResendConfirmationEmailCommand>
|
||||
{
|
||||
|
||||
@@ -5,9 +5,6 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Features.Emails.DependencyInjection;
|
||||
|
||||
/// <summary>
|
||||
/// Registers the services owned by the Emails feature slice.
|
||||
/// </summary>
|
||||
public static class FeaturesEmailsServiceCollectionExtensions
|
||||
{
|
||||
public static IServiceCollection AddFeaturesEmails(this IServiceCollection services)
|
||||
|
||||
@@ -4,11 +4,8 @@ using Infrastructure.Email.Templates.Rendering;
|
||||
namespace Features.Emails.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Default implementation of <see cref="IEmailDispatcher" /> that renders email templates and dispatches
|
||||
/// them via an <see cref="IEmailProvider" />.
|
||||
/// Default implementation of <see cref="IEmailDispatcher" />.
|
||||
/// </summary>
|
||||
/// <param name="emailProvider">Provider used to deliver the rendered emails.</param>
|
||||
/// <param name="emailTemplateProvider">Provider used to render HTML email bodies from templates.</param>
|
||||
public class EmailDispatcher(
|
||||
IEmailProvider emailProvider,
|
||||
IEmailTemplateProvider emailTemplateProvider
|
||||
@@ -25,10 +22,6 @@ public class EmailDispatcher(
|
||||
Environment.GetEnvironmentVariable("WEBSITE_BASE_URL")
|
||||
?? throw new InvalidOperationException("WEBSITE_BASE_URL environment variable is not set");
|
||||
|
||||
/// <summary>
|
||||
/// Builds a confirmation link from the given token, renders the registration welcome email template,
|
||||
/// and sends it to the newly created user.
|
||||
/// </summary>
|
||||
public async Task SendRegistrationEmailAsync(
|
||||
string firstName,
|
||||
string email,
|
||||
@@ -45,10 +38,6 @@ public class EmailDispatcher(
|
||||
await emailProvider.SendAsync(email, "Welcome to The Biergarten App!", emailHtml, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Builds a confirmation link from the given token, renders the resend-confirmation email template,
|
||||
/// and sends it to the user.
|
||||
/// </summary>
|
||||
public async Task SendResendConfirmationEmailAsync(
|
||||
string firstName,
|
||||
string email,
|
||||
|
||||
@@ -1,25 +1,17 @@
|
||||
namespace Features.Emails.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Defines operations for sending account-related emails, such as registration and confirmation resend emails.
|
||||
/// Defines operations for sending account-related emails.
|
||||
/// </summary>
|
||||
public interface IEmailDispatcher
|
||||
{
|
||||
/// <summary>
|
||||
/// Sends a welcome email containing an account confirmation link to a newly registered user.
|
||||
/// </summary>
|
||||
/// <param name="firstName">The recipient's first name, used to personalize the email.</param>
|
||||
/// <param name="email">The recipient's email address.</param>
|
||||
/// <param name="confirmationToken">The confirmation token to embed in the confirmation link.</param>
|
||||
/// <returns>A task that completes once the email has been sent.</returns>
|
||||
Task SendRegistrationEmailAsync(string firstName, string email, string confirmationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Sends an email containing a fresh account confirmation link to a user who requested a resend.
|
||||
/// </summary>
|
||||
/// <param name="firstName">The recipient's first name, used to personalize the email.</param>
|
||||
/// <param name="email">The recipient's email address.</param>
|
||||
/// <param name="confirmationToken">The confirmation token to embed in the confirmation link.</param>
|
||||
/// <returns>A task that completes once the email has been sent.</returns>
|
||||
Task SendResendConfirmationEmailAsync(string firstName, string email, string confirmationToken);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user