mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-07-16 17:47:22 +00:00
24 lines
808 B
C#
24 lines
808 B
C#
using Features.Emails.Services;
|
|
using MediatR;
|
|
using Shared.Application.Emails;
|
|
|
|
namespace Features.Emails.Commands.SendRegistrationEmail;
|
|
|
|
/// <summary>
|
|
/// 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>
|
|
{
|
|
public Task Handle(SendRegistrationEmailCommand request, CancellationToken cancellationToken)
|
|
{
|
|
return emailDispatcher.SendRegistrationEmailAsync(
|
|
request.FirstName,
|
|
request.Email,
|
|
request.ConfirmationToken
|
|
);
|
|
}
|
|
}
|