Clean Architecture Demo
Loading...
Searching...
No Matches
TaskCompletedNotificationHandler.cs
Go to the documentation of this file.
3
5
17public sealed class TaskCompletedNotificationHandler : IDomainEventSubscriber<TaskCompletedEvent>
18{
19 private readonly IEmailService _emailService;
20
22 {
23 _emailService = emailService;
24 }
25
26 public Task HandleAsync(TaskCompletedEvent domainEvent, CancellationToken cancellationToken = default)
27 {
28 ArgumentNullException.ThrowIfNull(domainEvent);
29
30 return _emailService.SendTaskCompletedNotificationAsync(domainEvent.TaskId, cancellationToken);
31 }
32}
Task HandleAsync(TaskCompletedEvent domainEvent, CancellationToken cancellationToken=default)
IEmailService es la abstracción para envío de notificaciones por correo electrónico.