mirror of
https://github.com/farcasclaudiu/PracticeCalendar.git
synced 2026-06-22 07:01:16 +03:00
refactoring and integration tests
This commit is contained in:
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user