refactoring and integration tests

This commit is contained in:
2022-10-10 04:02:46 +03:00
parent 28a6981001
commit ec54d2c255
15 changed files with 172 additions and 7 deletions
@@ -0,0 +1,24 @@
using MediatR;
using PracticeCalendar.Domain.Common;
using PracticeCalendar.Domain.Events;
using PracticeCalendar.Domain.Interfaces;
namespace PracticeCalendar.Application.PracticeEvents.Events
{
public class AttendeeAddedEventNotification : INotificationHandler<DomainEventNotification<AttendeeAddedEvent>>
{
private readonly IEmailSender emailSender;
public AttendeeAddedEventNotification(IEmailSender emailSender)
{
this.emailSender = emailSender;
}
public async Task Handle(DomainEventNotification<AttendeeAddedEvent> notification, CancellationToken cancellationToken)
{
var sendTo = notification.DomainEvent.AddedAtendee.EmailAddress;
await emailSender.SendEmailAsync(sendTo, "system",
"You have been added to the event", "Confirmed you have been added to the event.");
}
}
}